com.mongodb.casbah

MongoTypedCollection

trait MongoTypedCollection extends MongoCollectionBase

Concrete collection implementation for typed Cursor operations via Collection.setObjectClass et al This is a special case collection for typed operations

Source
MongoCollection.scala
Version

2.0, 12/23/10

Since

1.0

Linear Supertypes
MongoCollectionBase, Logging, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MongoTypedCollection
  2. MongoCollectionBase
  3. Logging
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. abstract type CursorType

    Definition Classes
    MongoCollectionBase
  2. abstract type T <: Imports.DBObject

    Definition Classes
    MongoCollectionBase

Abstract Value Members

  1. abstract 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)

    Definition Classes
    MongoCollectionBase
  2. abstract 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)

    Definition Classes
    MongoCollectionBase
  3. abstract def underlying: DBCollection

    The underlying Java Mongo Driver Collection object we proxy.

    The underlying Java Mongo Driver Collection object we proxy.

    Definition Classes
    MongoCollectionBase

Concrete Value Members

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

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

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

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

    Save an object to the Collection

    Save an object to the Collection

    x

    object to save to the collection

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

    Remove a matching object from the collection

    Remove a matching object from the collection

    x

    object to remove from the collection

    Definition Classes
    MongoCollectionBase
  6. final def ==(arg0: AnyRef): Boolean

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

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

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

    Manipulate Network Options

    Manipulate Network Options

    Definition Classes
    MongoCollectionBase
    See also

    com.mongodb.Bytes

    com.mongodb.Mongo

  10. def aggregate[A](args: Iterable[A])(implicit arg0: (A) ⇒ Imports.DBObject): AggregationOutput

    performs an aggregation operation

    performs an aggregation operation

    args

    the aggregation pipeline

    returns

    The aggregation operation's result set

    Definition Classes
    MongoCollectionBase
  11. def aggregate(args: Imports.DBObject*): AggregationOutput

    performs an aggregation operation

    performs an aggregation operation

    args

    the aggregation pipeline

    returns

    The aggregation operation's result set

    Definition Classes
    MongoCollectionBase
  12. def apply[A](jo: A, ensureID: Boolean)(implicit arg0: (A) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
  13. def apply[A](o: A)(implicit arg0: (A) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
  14. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  15. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. 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

    Definition Classes
    MongoCollectionBase
  17. def count[A, B](query: A, fields: B, limit: Long, skip: Long, readPrefs: Imports.ReadPreference)(implicit arg0: (A) ⇒ Imports.DBObject, arg1: (B) ⇒ Imports.DBObject): Long

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

    Definition Classes
    MongoCollectionBase
  19. def createIndex[A](keys: A)(implicit arg0: (A) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
  20. def customDecoderFactory: Option[DBDecoderFactory]

    Definition Classes
    MongoCollectionBase
  21. def customEncoderFactory: Option[DBEncoderFactory]

    Definition Classes
    MongoCollectionBase
  22. 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

    Definition Classes
    MongoCollectionBase
  23. def distinct[A](key: String, query: A, readPrefs: Imports.ReadPreference)(implicit arg0: (A) ⇒ Imports.DBObject): Buffer[_]

    find distinct values for a key

    find distinct values for a key

    query

    query to apply on collection

    Definition Classes
    MongoCollectionBase
  24. def drop(): Unit

    Drops (deletes) this collection

    Drops (deletes) this collection

    Definition Classes
    MongoCollectionBase
  25. def dropCollection(): Unit

    Drops (deletes) this collection

    Drops (deletes) this collection

    Definition Classes
    MongoCollectionBase
  26. def dropIndex(name: String): Unit

    Definition Classes
    MongoCollectionBase
  27. def dropIndex[A](keys: A)(implicit arg0: (A) ⇒ Imports.DBObject): Unit

    Definition Classes
    MongoCollectionBase
  28. def dropIndexes(name: String): Unit

    Definition Classes
    MongoCollectionBase
  29. def dropIndexes(): Unit

    Drops all indices from this collection

    Drops all indices from this collection

    Definition Classes
    MongoCollectionBase
  30. def ensureIndex(fieldName: 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. This creates an ascending index on a particular field.

    Definition Classes
    MongoCollectionBase
  31. def ensureIndex[A](keys: A, name: String, unique: Boolean)(implicit arg0: (A) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
  32. def ensureIndex[A](keys: A, name: String)(implicit arg0: (A) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
  33. def ensureIndex[A, B](keys: A, options: B)(implicit arg0: (A) ⇒ Imports.DBObject, arg1: (B) ⇒ Imports.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

    options

    options for the index (name, unique, etc)

    Definition Classes
    MongoCollectionBase
  34. def ensureIndex[A](keys: A)(implicit arg0: (A) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
  35. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  36. 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
  37. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  38. def find[A, B](ref: A, fields: B, numToSkip: Int, batchSize: Int)(implicit arg0: (A) ⇒ Imports.DBObject, arg1: (B) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
  39. def find[A, B](ref: A, keys: B)(implicit arg0: (A) ⇒ Imports.DBObject, arg1: (B) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
  40. def find[A](ref: A)(implicit arg0: (A) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
  41. 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

    Definition Classes
    MongoCollectionBase
  42. def findAndModify[A, B, C, D](query: A, fields: B, sort: C, remove: Boolean, update: D, returnNew: Boolean, upsert: Boolean)(implicit arg0: (A) ⇒ Imports.DBObject, arg1: (B) ⇒ Imports.DBObject, arg2: (C) ⇒ Imports.DBObject, arg3: (D) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
  43. def findAndModify[A, B, C](query: A, sort: B, update: C)(implicit arg0: (A) ⇒ Imports.DBObject, arg1: (B) ⇒ Imports.DBObject, arg2: (C) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
  44. def findAndModify[A, B](query: A, update: B)(implicit arg0: (A) ⇒ Imports.DBObject, arg1: (B) ⇒ Imports.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)

    Definition Classes
    MongoCollectionBase
  45. def findAndRemove[A](query: A)(implicit arg0: (A) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
  46. def findOne[A, B](o: A, fields: B, readPrefs: Imports.ReadPreference)(implicit arg0: (A) ⇒ Imports.DBObject, arg1: (B) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
  47. def findOne[A](o: A)(implicit arg0: (A) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
  48. 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

    Definition Classes
    MongoCollectionBase
  49. def findOneByID[B](id: AnyRef, fields: B)(implicit arg0: (B) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
  50. 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

    Definition Classes
    MongoCollectionBase
  51. 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

    Definition Classes
    MongoCollectionBase
  52. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  53. 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

    Definition Classes
    MongoCollectionBase
  54. def getCount[A, B](query: A, fields: B, limit: Long, skip: Long, readPrefs: Imports.ReadPreference)(implicit arg0: (A) ⇒ Imports.DBObject, arg1: (B) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
  55. 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

    Definition Classes
    MongoCollectionBase
  56. 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

    Definition Classes
    MongoCollectionBase
  57. def getIndexInfo(): Buffer[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

    Definition Classes
    MongoCollectionBase
  58. def getLastError(w: Int, wTimeout: Int, fsync: Boolean): CommandResult

    Definition Classes
    MongoCollectionBase
  59. def getLastError(concern: Imports.WriteConcern): CommandResult

    Definition Classes
    MongoCollectionBase
  60. 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

    Definition Classes
    MongoCollectionBase
  61. def getName(): String

    Definition Classes
    MongoCollectionBase
  62. def getObjectClass(): Class[_]

    Gets the default class for objects in the collection

    Gets the default class for objects in the collection

    returns

    the class

    Definition Classes
    MongoCollectionBase
  63. def getOptions(): Int

    Manipulate Network Options

    Manipulate Network Options

    Definition Classes
    MongoCollectionBase
    See also

    com.mongodb.Bytes

    com.mongodb.Mongo

  64. def getReadPreference: ReadPreference

    Gets the read preference for this collection.

    Gets the read preference for this collection. Will be used as default for reads from any collection in this collection. See the documentation for ReadPreference for more information.

    Definition Classes
    MongoCollectionBase
  65. def getStats(): CommandResult

    Definition Classes
    MongoCollectionBase
  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 com.mongodb.WriteConcern for more info.

    Definition Classes
    MongoCollectionBase
    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, readPrefs: Imports.ReadPreference)(implicit arg0: (A) ⇒ Imports.DBObject, arg1: (B) ⇒ Imports.DBObject, arg2: (C) ⇒ Imports.DBObject): Iterable[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.

    Definition Classes
    MongoCollectionBase
  68. def hashCode(): Int

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

    Set hint fields for this collection.

    Set hint fields for this collection.

    Definition Classes
    MongoCollectionBase
  70. def indexInfo: Buffer[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

    Definition Classes
    MongoCollectionBase
  71. def insert[A](docs: A*)(implicit dbObjView: (A) ⇒ Imports.DBObject, concern: WriteConcern, encoder: Imports.DBEncoder): Imports.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

    Definition Classes
    MongoCollectionBase
  72. def insert[A](doc: A, concern: WriteConcern)(implicit dbObjView: (A) ⇒ Imports.DBObject): Imports.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

    Definition Classes
    MongoCollectionBase
  73. def internalClass_=(path: String, c: Class[_]): Unit

    Definition Classes
    MongoCollectionBase
  74. def isCapped: Boolean

    Definition Classes
    MongoCollectionBase
  75. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  76. def iterator: CursorType

    Definition Classes
    MongoCollectionBase
  77. def lastError(w: Int, wTimeout: Int, fsync: Boolean): CommandResult

    Definition Classes
    MongoCollectionBase
  78. def lastError(concern: Imports.WriteConcern): CommandResult

    Definition Classes
    MongoCollectionBase
  79. def lastError(): CommandResult

    Definition Classes
    MongoCollectionBase
  80. var log: Logger

    Attributes
    protected[com.mongodb.casbah]
    Definition Classes
    Logging
  81. def mapReduce(cmd: map_reduce.MapReduceCommand): MapReduceResult

    Definition Classes
    MongoCollectionBase
  82. def mapReduce(mapFunction: Imports.JSFunction, reduceFunction: Imports.JSFunction, output: Imports.MapReduceOutputTarget, query: Option[Imports.DBObject] = None, sort: Option[Imports.DBObject] = None, limit: Option[Int] = None, finalizeFunction: Option[Imports.JSFunction] = None, jsScope: Option[Imports.DBObject] = 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

    Definition Classes
    MongoCollectionBase
  83. def name: String

    Definition Classes
    MongoCollectionBase
  84. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  85. final def notify(): Unit

    Definition Classes
    AnyRef
  86. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  87. def objectClass: Class[_]

    Gets the default class for objects in the collection

    Gets the default class for objects in the collection

    returns

    the class

    Definition Classes
    MongoCollectionBase
  88. def objectClass_=[A <: Imports.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])

    Definition Classes
    MongoCollectionBase
  89. def options: Int

    Manipulate Network Options

    Manipulate Network Options

    Definition Classes
    MongoCollectionBase
    See also

    com.mongodb.Bytes

    com.mongodb.Mongo

  90. def readPreference: ReadPreference

    Gets the read preference for this collection.

    Gets the read preference for this collection. Will be used as default for reads from any collection in this collection. See the documentation for ReadPreference for more information.

    Definition Classes
    MongoCollectionBase
  91. def readPreference_=(pref: Imports.ReadPreference): Unit

    Sets the read preference for this collection.

    Sets the read preference for this collection. Will be used as default for reads from any collection in this collection. See the documentation for ReadPreference for more information.

    Definition Classes
    MongoCollectionBase
  92. def remove[A](o: A, concern: WriteConcern)(implicit dbObjView: (A) ⇒ Imports.DBObject, encoder: Imports.DBEncoder): WriteResult

    Removes objects from the database collection.

    Removes objects from the database collection.

    o

    the object that documents to be removed must match

    concern

    WriteConcern for this operation TODO - Wrapper for WriteResult?

    Definition Classes
    MongoCollectionBase
  93. 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

    Definition Classes
    MongoCollectionBase
  94. 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

    Definition Classes
    MongoCollectionBase
  95. def request(writeConcern: Imports.WriteConcern)(op: (MongoTypedCollection.this.type) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
    Exceptions thrown
    MongoException

  96. def request(w: Int, wTimeout: Int = 0, fsync: Boolean = false)(op: (MongoTypedCollection.this.type) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
    Exceptions thrown
    MongoException

  97. def request(op: (MongoTypedCollection.this.type) ⇒ Imports.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.

    Definition Classes
    MongoCollectionBase
    Exceptions thrown
    MongoException

  98. def resetIndexCache(): Unit

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

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

    Definition Classes
    MongoCollectionBase
  99. def resetOptions(): Unit

    Manipulate Network Options

    Manipulate Network Options

    Definition Classes
    MongoCollectionBase
    See also

    com.mongodb.Bytes

    com.mongodb.Mongo

  100. def save[A](o: A, concern: WriteConcern)(implicit dbObjView: (A) ⇒ Imports.DBObject): WriteResult

    Saves an object to this collection.

    Saves an object to this collection.

    o

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

    Definition Classes
    MongoCollectionBase
  101. def setHintFields[A](docs: List[A])(implicit arg0: (A) ⇒ Imports.DBObject): Unit

    Set hint fields for this collection.

    Set hint fields for this collection.

    Definition Classes
    MongoCollectionBase
  102. def setInternalClass(path: String, c: Class[_]): Unit

    Definition Classes
    MongoCollectionBase
  103. def setObjectClass[A <: Imports.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])

    Definition Classes
    MongoCollectionBase
  104. def setReadPreference(pref: Imports.ReadPreference): Unit

    Sets the read preference for this collection.

    Sets the read preference for this collection. Will be used as default for reads from any collection in this collection. See the documentation for ReadPreference for more information.

    Definition Classes
    MongoCollectionBase
  105. def setWriteConcern(concern: Imports.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 com.mongodb.WriteConcern for more info.

    concern

    (WriteConcern) The write concern to use

    Definition Classes
    MongoCollectionBase
    See also

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

    WriteConcern

  106. def stats: CommandResult

    Definition Classes
    MongoCollectionBase
  107. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  108. def toString(): String

    Definition Classes
    MongoCollectionBase → AnyRef → Any
  109. def update[A, B](q: A, o: B, upsert: Boolean, multi: Boolean, concern: WriteConcern)(implicit queryView: (A) ⇒ Imports.DBObject, objView: (B) ⇒ Imports.DBObject, encoder: Imports.DBEncoder): 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?

    Definition Classes
    MongoCollectionBase
  110. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  113. 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 com.mongodb.WriteConcern for more info.

    Definition Classes
    MongoCollectionBase
    See also

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

    WriteConcern

  114. def writeConcern_=(concern: Imports.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 com.mongodb.WriteConcern for more info.

    concern

    (WriteConcern) The write concern to use

    Definition Classes
    MongoCollectionBase
    See also

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

    WriteConcern

Deprecated Value Members

  1. def slaveOk(): Unit

    Sets queries to be OK to run on slave nodes.

    Sets queries to be OK to run on slave nodes.

    Definition Classes
    MongoCollectionBase
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) Replaced with ReadPreference.SECONDARY

  2. def updateMulti[A, B](q: A, o: B)(implicit arg0: (A) ⇒ Imports.DBObject, arg1: (B) ⇒ Imports.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

    Definition Classes
    MongoCollectionBase
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) In the face of default arguments this is a bit silly. Please use update(multi=True)

Inherited from MongoCollectionBase

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped