com.mongodb.casbah

MongoCollectionBase

trait MongoCollectionBase extends Logging

Scala wrapper for Mongo DBCollections, including ones which return custom DBObject subclasses via setObjectClass and the like. Provides any non-parameterized methods and the basic structure. Requires an underlying object of a DBCollection.

This is a rewrite of the Casbah 1.0 approach which was rather naive and unecessarily complex.... formerly was MongoCollectionWrapper

Self Type
MongoCollectionBase
Source
MongoCollection.scala
Version

2.0, 12/23/10

Since

1.0

Linear Supertypes
Logging, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. MongoCollectionBase
  2. Logging
  3. AnyRef
  4. Any
Visibility
  1. Public
  2. All

Type Members

  1. type CursorType

    Attributes
    abstract
  2. type T <: DBObject

    Attributes
    abstract

Abstract Value Members

  1. def _newCursor (cursor: DBCursor): CursorType

    _newCursor

    _newCursor

    Utility method which concrete subclasses are expected to implement for creating a new instance of the correct cursor implementation from a Java cursor. Good with cursor calls that return a new cursor. Should figure out the right type to return based on typing setup.

    cursor

    (DBCursor)

    returns

    (MongoCursorBase)

    Attributes
    abstract
  2. def _newInstance (collection: DBCollection): MongoCollectionBase

    _newInstance

    _newInstance

    Utility method which concrete subclasses are expected to implement for creating a new instance of THIS concrete implementation from a Java collection. Good with calls that return a new collection.

    returns

    (this.type)

    Attributes
    abstract
  3. val underlying : DBCollection

    The underlying Java Mongo Driver Collection object we proxy.

    The underlying Java Mongo Driver Collection object we proxy.

    Attributes
    abstract

Concrete Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def += [A] (x: A)(implicit arg0: (A) ⇒ DBObject): WriteResult

    Save an object to the Collection

    Save an object to the Collection

    x

    object to save to the collection

  5. def -= [A] (x: A)(implicit arg0: (A) ⇒ DBObject): WriteResult

    Remove a matching object from the collection

    Remove a matching object from the collection

    x

    object to remove from the collection

  6. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  7. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  8. def _typedValue (dbObj: DBObject): Option[T]

    Attributes
    protected
  9. def addOption (option: Int): Unit

    Manipulate Network Options

    Manipulate Network Options

    See also

    com.mongodb.Bytes

    ,

    com.mongodb.Mongo

  10. def apply [A] (jo: A, ensureID: Boolean)(implicit arg0: (A) ⇒ DBObject): AnyRef

    Adds the "private" fields _id to an object.

    Adds the "private" fields _id to an object.

    jo

    object to which to add fields

    ensureID

    whether to add an _id field or not

    returns

    the modified object o

  11. def apply [A] (o: A)(implicit arg0: (A) ⇒ DBObject): AnyRef

    Adds the "private" fields _id to an object.

    Adds the "private" fields _id to an object.

    o

    DBObject to which to add fields

    returns

    the modified parameter object

  12. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  13. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. def collection (n: String): MongoCollection

    Find a collection that is prefixed with this collection's name.

    Find a collection that is prefixed with this collection's name. A typical use of this might be

       DBCollection users = mongo.getCollection( "wiki" ).getCollection( "users" );
    
    Which is equilalent to
    DBCollection users = mongo.getCollection( "wiki.users" );

    n

    the name of the collection to find

    returns

    the matching collection

    TODO - Make this support type construction

  15. def count [A, B] (query: A, fields: B)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject): Long

  16. def count [A] (query: A)(implicit arg0: (A) ⇒ DBObject): Long

  17. def count : Long

  18. def createIndex [A, B] (keys: A, options: B)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject): Unit

  19. def createIndex [A] (keys: A)(implicit arg0: (A) ⇒ DBObject): Unit

    Forces creation of an index on a set of fields, if one does not already exist.

    Forces creation of an index on a set of fields, if one does not already exist.

    keys

    an object with a key set of the fields desired for the index

  20. implicit val db : MongoDB

    Returns the database this collection is a member of.

    Returns the database this collection is a member of.

    returns

    this collection's database

    Attributes
    implicit
  21. def distinct [A] (key: String, query: A)(implicit arg0: (A) ⇒ DBObject): Seq[Any]

    find distinct values for a key

    find distinct values for a key

    query

    query to apply on collection

  22. def distinct (key: String): Seq[Any]

    find distinct values for a key

  23. def drop (): Unit

    Drops (deletes) this collection

  24. def dropCollection (): Unit

    Drops (deletes) this collection

  25. def dropIndex (name: String): Unit

  26. def dropIndex [A] (keys: A)(implicit arg0: (A) ⇒ DBObject): Unit

  27. def dropIndexes (name: String): Unit

  28. def dropIndexes (): Unit

    Drops all indices from this collection

  29. def ensureIndex (name: String): Unit

    Ensures an index on this collection (that is, the index will be created if it does not exist).

    Ensures an index on this collection (that is, the index will be created if it does not exist). ensureIndex is optimized and is inexpensive if the index already exists.

    name

    an identifier for the index

  30. def ensureIndex [A] (keys: A, name: String, unique: Boolean)(implicit arg0: (A) ⇒ DBObject): Unit

    Ensures an optionally unique index on this collection.

    Ensures an optionally unique index on this collection.

    keys

    fields to use for index

    name

    an identifier for the index

    unique

    if the index should be unique

  31. def ensureIndex [A] (keys: A, name: String)(implicit arg0: (A) ⇒ DBObject): Unit

    Ensures an index on this collection (that is, the index will be created if it does not exist).

    Ensures an index on this collection (that is, the index will be created if it does not exist). ensureIndex is optimized and is inexpensive if the index already exists.

    keys

    fields to use for index

    name

    an identifier for the index

  32. def ensureIndex [A] (keys: A)(implicit arg0: (A) ⇒ DBObject): Unit

    Creates an index on a set of fields, if one does not already exist.

    Creates an index on a set of fields, if one does not already exist.

    keys

    an object with a key set of the fields desired for the index

  33. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  34. def equals (obj: Any): Boolean

    Checks if this collection is equal to another object.

    Checks if this collection is equal to another object.

    returns

    if the two collections are the same object

    Definition Classes
    MongoCollectionBase → AnyRef → Any
  35. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  36. def find [A, B] (ref: A, fields: B, numToSkip: Int, batchSize: Int)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject): CursorType

    Finds an object.

    Finds an object.

    ref

    query used to search

    fields

    the fields of matching objects to return

    numToSkip

    will not return the first numToSkip matches

    batchSize

    if positive, is the # of objects per batch sent back from the db. all objects that match will be returned. if batchSize < 0, its a hard limit, and only 1 batch will either batchSize or the # that fit in a batch

    returns

    the objects, if found

  37. def find [A, B] (ref: A, keys: B)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject): CursorType

    Queries for an object in this collection.

    Queries for an object in this collection.

    An empty DBObject will match every document in the collection. Regardless of fields specified, the _id fields are always returned.

    An example that returns the "x" and "_id" fields for every document in the collection that has an "x" field:

    BasicDBObject keys = new BasicDBObject();
    keys.put("x", 1);
    
    DBCursor cursor = collection.find(new BasicDBObject(), keys);
    

    ref

    object for which to search

    keys

    fields to return

    returns

    a cursor to iterate over results

  38. def find [A] (ref: A)(implicit arg0: (A) ⇒ DBObject): CursorType

    Queries for an object in this collection.

    Queries for an object in this collection.

    ref

    object for which to search

    returns

    an iterator over the results

  39. def find (): CursorType

    Queries for all objects in this collection.

    Queries for all objects in this collection.

    returns

    a cursor which will iterate over every object

  40. def findAndModify [A, B, C, D] (query: A, fields: B, sort: C, remove: Boolean, update: D, returnNew: Boolean, upsert: Boolean)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject, arg2: (C) ⇒ DBObject, arg3: (D) ⇒ DBObject): Option[T]

    Finds the first document in the query and updates it.

    Finds the first document in the query and updates it.

    returns

    the old document

  41. def findAndModify [A, B, C] (query: A, sort: B, update: C)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject, arg2: (C) ⇒ DBObject): Option[T]

    Finds the first document in the query (sorted) and updates it.

    Finds the first document in the query (sorted) and updates it.

    returns

    the old document

  42. def findAndModify [A, B] (query: A, update: B)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject): Option[T]

    Finds the first document in the query (sorted) and updates it.

    Finds the first document in the query (sorted) and updates it. If remove is specified it will be removed. If new is specified then the updated document will be returned, otherwise the old document is returned (or it would be lost forever). You can also specify the fields to return in the document, optionally.

    returns

    (Option[T]) of the the found document (before, or after the update)

  43. def findAndRemove [A] (query: A)(implicit arg0: (A) ⇒ DBObject): Option[T]

    Finds the first document in the query and removes it.

    Finds the first document in the query and removes it.

    returns

    the removed document

  44. def findOne [A, B] (o: A, fields: B)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject): Option[T]

    Returns a single object from this collection matching the query.

    Returns a single object from this collection matching the query.

    o

    the query object

    fields

    fields to return

    returns

    (Option[T]) Some() of the object found, or None if no such object exists

  45. def findOne [A] (o: A)(implicit arg0: (A) ⇒ DBObject): Option[T]

    Returns a single object from this collection matching the query.

    Returns a single object from this collection matching the query.

    o

    the query object

    returns

    (Option[T]) Some() of the object found, or None if no such object exists

  46. def findOne (): Option[T]

    Returns a single object from this collection.

    Returns a single object from this collection.

    returns

    (Option[T]) Some() of the object found, or None if this collection is empty

  47. def findOneByID [B] (id: AnyRef, fields: B)(implicit arg0: (B) ⇒ DBObject): Option[T]

    Find an object by its ID.

    Find an object by its ID. Finds an object by its id. This compares the passed in value to the _id field of the document.

    Returns a single object from this collection matching the query.

    id

    the id to match

    fields

    fields to return

    returns

    (Option[T]) Some() of the object found, or None if no such object exists

  48. def findOneByID (id: AnyRef): Option[T]

    Find an object by its ID.

    Find an object by its ID. Finds an object by its id. This compares the passed in value to the _id field of the document.

    Returns a single object from this collection matching the query.

    id

    the id to match

    returns

    (Option[T]) Some() of the object found, or None if no such object exists

  49. def fullName : String

    Returns the full name of this collection, with the database name as a prefix.

    Returns the full name of this collection, with the database name as a prefix.

    returns

    the name of this collection

  50. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef
  51. def getCollection (n: String): MongoCollection

    Find a collection that is prefixed with this collection's name.

    Find a collection that is prefixed with this collection's name. A typical use of this might be

       DBCollection users = mongo.getCollection( "wiki" ).getCollection( "users" );
    
    Which is equilalent to
    DBCollection users = mongo.getCollection( "wiki.users" );

    n

    the name of the collection to find

    returns

    the matching collection

    TODO - Make this support type construction

  52. def getCount [A, B] (query: A, fields: B, limit: Long, skip: Long)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject): Long

    Returns the number of documents in the collection that match the specified query

    Returns the number of documents in the collection that match the specified query

    query

    query to select documents to count

    fields

    fields to return

    limit

    Max # of fields

    skip

    # of fields to skip

    returns

    number of documents that match query and fields

  53. def getCount [A, B] (query: A, fields: B)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject): Long

    Returns the number of documents in the collection that match the specified query

    Returns the number of documents in the collection that match the specified query

    query

    query to select documents to count

    fields

    fields to return

    returns

    number of documents that match query and fields

  54. def getCount [A] (query: A)(implicit arg0: (A) ⇒ DBObject): Long

    Returns the number of documents in the collection that match the specified query

    Returns the number of documents in the collection that match the specified query

    query

    query to select documents to count

    returns

    number of documents that match query

  55. def getCount (): Long

    Returns the number of documents in the collection

    Returns the number of documents in the collection

    returns

    number of documents in the query

  56. def getDB (): MongoDB

    Returns the database this collection is a member of.

    Returns the database this collection is a member of.

    returns

    this collection's database

  57. def getFullName (): String

    Returns the full name of this collection, with the database name as a prefix.

    Returns the full name of this collection, with the database name as a prefix.

    returns

    the name of this collection

  58. def getIndexInfo (): Seq[DBObject]

    Return a list of the indexes for this collection.

    Return a list of the indexes for this collection. Each object in the list is the "info document" from MongoDB

    returns

    list of index documents

  59. def getLastError (w: Int, wTimeout: Int, fsync: Boolean): CommandResult

  60. def getLastError (writeConcern: WriteConcern): CommandResult

  61. def getLastError (): CommandResult

    Gets the the error (if there is one) from the previous operation.

    Gets the the error (if there is one) from the previous operation. The result of this command will look like

    { "err" :  errorMessage  , "ok" : 1.0 }
    

    The value for errorMessage will be null if no error occurred, or a description otherwise.

    Care must be taken to ensure that calls to getLastError go to the same connection as that of the previous operation. See com.mongodb.Mongo.requestStart for more information.

    returns

    DBObject with error and status information

  62. def getName (): String

  63. def getObjectClass (): java.lang.Class[_]

    Gets the default class for objects in the collection

    Gets the default class for objects in the collection

    returns

    the class

  64. def getOptions (): Int

    Manipulate Network Options

    Manipulate Network Options

    See also

    com.mongodb.Bytes

    ,

    com.mongodb.Mongo

  65. def getStats (): CommandResult

  66. def getWriteConcern (): WriteConcern

    get the write concern for this database, which is used for writes to any collection in this database.

    get the write concern for this database, which is used for writes to any collection in this database. See the documentation for WriteConcern for more info.

    See also

    http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/

    ,

    WriteConcern

  67. def group [A, B, C] (key: A, cond: B, initial: C, reduce: String, finalize: String)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject, arg2: (C) ⇒ DBObject): ArrayBuffer[T]

    Enables you to call group with the finalize parameter (a function that runs on each row of the output for calculations before sending a return) which the Mongo Java driver does not yet support, by sending a direct DBObject command.

    Enables you to call group with the finalize parameter (a function that runs on each row of the output for calculations before sending a return) which the Mongo Java driver does not yet support, by sending a direct DBObject command. Messy, but it works.

  68. def group [A, B] (key: A, cond: B, function: String)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject): Iterable[T]

  69. def group [A, B] (key: A, cond: B)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject): Iterable[T]

    Perform an absurdly simple grouping with no initial object or reduce function.

  70. def group [A, B, C] (key: A, cond: B, initial: C, reduce: String)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject, arg2: (C) ⇒ DBObject): Iterable[T]

  71. def hashCode (): Int

    Definition Classes
    MongoCollectionBase → AnyRef → Any
  72. def hintFields_= [A] (docs: List[A])(implicit arg0: (A) ⇒ DBObject): Unit

    Set hint fields for this collection.

  73. def indexInfo : Seq[DBObject]

    Return a list of the indexes for this collection.

    Return a list of the indexes for this collection. Each object in the list is the "info document" from MongoDB

    returns

    list of index documents

  74. def insert [A] (docs: List[A])(implicit arg0: (A) ⇒ DBObject): WriteResult

    Saves document(s) to the database.

    Saves document(s) to the database. if doc doesn't have an _id, one will be added you can get the _id that was added from doc after the insert

  75. def insert [A] (doc: A, writeConcern: WriteConcern)(implicit arg0: (A) ⇒ DBObject): WriteResult

    Inserts a document into the database.

    Inserts a document into the database. if doc doesn't have an _id, one will be added you can get the _id that was added from doc after the insert

  76. def insert [A] (docs: Traversable[A], writeConcern: WriteConcern)(implicit arg0: (A) ⇒ DBObject): WriteResult

    Saves document(s) to the database.

    Saves document(s) to the database. if doc doesn't have an _id, one will be added you can get the _id that was added from doc after the insert

  77. def insert [A] (docs: A*)(implicit arg0: (A) ⇒ DBObject): WriteResult

    Saves document(s) to the database.

    Saves document(s) to the database. if doc doesn't have an _id, one will be added you can get the _id that was added from doc after the insert

  78. def internalClass_= (path: String, c: Class[_]): Unit

  79. def isCapped : Boolean

  80. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  81. def iterator : CursorType

  82. def lastError (w: Int, wTimeout: Int, fsync: Boolean): CommandResult

  83. def lastError (writeConcern: WriteConcern): CommandResult

  84. def lastError (): CommandResult

  85. var log : Logger

    Attributes
    protected[casbah]
    Definition Classes
    Logging
  86. def mapReduce (cmd: MapReduceCommand): MapReduceResult

  87. def mapReduce (mapFunction: JSFunction, reduceFunction: JSFunction, output: MapReduceOutputTarget, query: Option[DBObject] = None, sort: Option[DBObject] = None, limit: Option[Int] = None, finalizeFunction: Option[JSFunction] = None, jsScope: Option[String] = None, verbose: Boolean = false): MapReduceResult

    mapReduce Execute a mapReduce against this collection.

    mapReduce Execute a mapReduce against this collection. NOTE: JSFunction is just a type alias for String

    mapFunction

    (JSFunction) The JavaScript to execute for the map function

    reduceFunction

    (JSFunction) The JavaScript to execute for the reduce function

  88. def name : String

  89. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  90. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  91. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  92. def objectClass : java.lang.Class[_]

    Gets the default class for objects in the collection

    Gets the default class for objects in the collection

    returns

    the class

  93. def objectClass_= [A <: DBObject] (c: Class[A])(implicit arg0: Manifest[A]): MongoGenericTypedCollection[A]

    setObjectClass

    setObjectClass

    Set a subtype of DBObject which will be used to deserialize documents returned from MongoDB.

    This method will return a new MongoTypedCollection[A] which you should capture if you want explicit casting. Else, this collection will instantiate instances of A but cast them to the current T (DBObject if you have a generic collection)

    A

    A Subtype of DBObject

    c

    (Class[A])

  94. def options : Int

    Manipulate Network Options

    Manipulate Network Options

    See also

    com.mongodb.Bytes

    ,

    com.mongodb.Mongo

  95. def remove [A] (o: A, writeConcern: WriteConcern)(implicit arg0: (A) ⇒ DBObject): WriteResult

    Removes objects from the database collection.

    Removes objects from the database collection.

    o

    the object that documents to be removed must match

  96. def remove [A] (o: A)(implicit arg0: (A) ⇒ DBObject): WriteResult

    Removes objects from the database collection.

    Removes objects from the database collection.

    o

    the object that documents to be removed must match

  97. def rename (newName: String, dropTarget: Boolean): MongoCollection

    does a rename of this collection to newName As per the Java API this returns a *NEW* Collection, and the old collection is probably no good anymore.

    does a rename of this collection to newName As per the Java API this returns a *NEW* Collection, and the old collection is probably no good anymore.

    This collection *WILL NOT* mutate --- the instance will still point at a now nonexistant collection with the old name ... You must capture the return value for the new instance.

    newName

    new collection name (not a full namespace)

    dropTarget

    if a collection with the new name exists, whether or not to drop it

    returns

    the new collection

  98. def rename (newName: String): MongoCollection

    does a rename of this collection to newName As per the Java API this returns a *NEW* Collection, and the old collection is probably no good anymore.

    does a rename of this collection to newName As per the Java API this returns a *NEW* Collection, and the old collection is probably no good anymore.

    This collection *WILL NOT* mutate --- the instance will still point at a now nonexistant collection with the old name ... You must capture the return value for the new instance.

    newName

    new collection name (not a full namespace)

    returns

    the new collection

  99. def request (writeConcern: WriteConcern)(op: (MongoCollectionBase.this.type) ⇒ WriteResult): Unit

    write concern aware write op block.

    write concern aware write op block.

    Checks getLastError after the last write. If you run multiple ops you'll only get the final error.

    Your op function gets a copy of this MongoDB instance.

    This is for write ops only - you cannot return data from it.

    Your function must return WriteResult, which is the return type of any mongo write operation like insert/save/update/remove

  100. def request (w: Int, wTimeout: Int = 0, fsync: Boolean = false)(op: (MongoCollectionBase.this.type) ⇒ WriteResult): Unit

    write concern aware write op block.

    write concern aware write op block.

    Checks getLastError after the last write. If you run multiple ops you'll only get the final error.

    Your op function gets a copy of this MongoDB instance.

    This is for write ops only - you cannot return data from it.

    Your function must return WriteResult, which is the return type of any mongo write operation like insert/save/update/remove

  101. def request (op: (MongoCollectionBase.this.type) ⇒ WriteResult): Unit

    write concern aware write op block.

    write concern aware write op block.

    Checks getLastError after the last write. If you run multiple ops you'll only get the final error.

    Your op function gets a copy of this MongoDB instance.

    This is for write ops only - you cannot return data from it.

    Your function must return WriteResult, which is the return type of any mongo write operation like insert/save/update/remove

    If you have set a connection or DB level WriteConcern, it will be inherited.

  102. def resetIndexCache (): Unit

    Clears all indices that have not yet been applied to this collection.

  103. def resetOptions (): Unit

    Manipulate Network Options

    Manipulate Network Options

    See also

    com.mongodb.Bytes

    ,

    com.mongodb.Mongo

  104. def save [A] (jo: A, writeConcern: WriteConcern)(implicit arg0: (A) ⇒ DBObject): WriteResult

    Saves an object to this collection.

    Saves an object to this collection.

    jo

    the DBObject to save will add _id field to jo if needed TODO - Wrapper for WriteResult?

  105. def save [A] (jo: A)(implicit arg0: (A) ⇒ DBObject): WriteResult

    Saves an object to this collection.

    Saves an object to this collection.

    jo

    the DBObject to save will add _id field to jo if needed TODO - Wrapper for WriteResult?

  106. def setHintFields [A] (docs: List[A])(implicit arg0: (A) ⇒ DBObject): Unit

    Set hint fields for this collection.

  107. def setInternalClass (path: String, c: Class[_]): Unit

  108. def setObjectClass [A <: DBObject] (c: Class[A])(implicit arg0: Manifest[A]): MongoGenericTypedCollection[A]

    setObjectClass

    setObjectClass

    Set a subtype of DBObject which will be used to deserialize documents returned from MongoDB.

    This method will return a new MongoTypedCollection[A] which you should capture if you want explicit casting. Else, this collection will instantiate instances of A but cast them to the current T (DBObject if you have a generic collection)

    A

    A Subtype of DBObject

    TODO - Ensure proper subtype return

    c

    (Class[A])

  109. def setWriteConcern (concern: WriteConcern): Unit

    Set the write concern for this database.

    Set the write concern for this database. Will be used for writes to any collection in this database. See the documentation for WriteConcern for more info.

    concern

    (WriteConcern) The write concern to use

    See also

    http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/

    ,

    WriteConcern

  110. def slaveOk (): Unit

    Sets queries to be OK to run on slave nodes.

  111. def stats : CommandResult

  112. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  113. def toString (): String

    Definition Classes
    MongoCollectionBase → AnyRef → Any
  114. def update [A, B] (q: A, o: B, upsert: Boolean, multi: Boolean, writeConcern: WriteConcern)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject): WriteResult

    Performs an update operation.

    Performs an update operation.

    q

    search query for old object to update

    o

    object with which to update q

    upsert

    if the database should create the element if it does not exist

    multi

    if the update should be applied to all objects matching (db version 1.1.3 and above)

    writeConcern

    WriteConcern for this operation

    See also

    http://www.mongodb.org/display/DOCS/Atomic+Operations

  115. def update [A, B] (q: A, o: B, upsert: Boolean, multi: Boolean)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject): WriteResult

    Performs an update operation.

    Performs an update operation.

    q

    search query for old object to update

    o

    object with which to update q

    upsert

    if the database should create the element if it does not exist

    multi

    if the update should be applied to all objects matching (db version 1.1.3 and above)

    See also

    http://www.mongodb.org/display/DOCS/Atomic+Operations

  116. def update [A, B] (q: A, o: B)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject): WriteResult

    Performs an update operation.

    Performs an update operation.

    q

    search query for old object to update

    o

    object with which to update q TODO - Wrapper for WriteResult?

  117. def updateMulti [A, B] (q: A, o: B)(implicit arg0: (A) ⇒ DBObject, arg1: (B) ⇒ DBObject): WriteResult

    Perform a multi update

    Perform a multi update

    q

    search query for old object to update

    o

    object with which to update q

  118. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  119. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  120. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  121. def writeConcern : WriteConcern

    get the write concern for this database, which is used for writes to any collection in this database.

    get the write concern for this database, which is used for writes to any collection in this database. See the documentation for WriteConcern for more info.

    See also

    http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/

    ,

    WriteConcern

  122. def writeConcern_= (concern: WriteConcern): Unit

    Set the write concern for this database.

    Set the write concern for this database. Will be used for writes to any collection in this database. See the documentation for WriteConcern for more info.

    concern

    (WriteConcern) The write concern to use

    See also

    http://www.thebuzzmedia.com/mongodb-single-server-data-durability-guide/

    ,

    WriteConcern

Inherited from Logging

Inherited from AnyRef

Inherited from Any