Class/Object

com.mongodb.casbah

MongoCollection

Related Docs: object MongoCollection | package casbah

Permalink

class MongoCollection extends MongoCollectionBase with Iterable[casbah.commons.TypeImports.DBObject]

Concrete collection implementation expecting standard DBObject operation This is the version of MongoCollectionBase you should expect to use in most cases.

Version

2.0, 12/23/10

Since

1.0

Linear Supertypes
Iterable[commons.TypeImports.DBObject], IterableLike[commons.TypeImports.DBObject, Iterable[commons.TypeImports.DBObject]], Equals, GenIterable[commons.TypeImports.DBObject], GenIterableLike[commons.TypeImports.DBObject, Iterable[commons.TypeImports.DBObject]], Traversable[commons.TypeImports.DBObject], GenTraversable[commons.TypeImports.DBObject], GenericTraversableTemplate[commons.TypeImports.DBObject, Iterable], TraversableLike[commons.TypeImports.DBObject, Iterable[commons.TypeImports.DBObject]], GenTraversableLike[commons.TypeImports.DBObject, Iterable[commons.TypeImports.DBObject]], Parallelizable[commons.TypeImports.DBObject, ParIterable[commons.TypeImports.DBObject]], TraversableOnce[commons.TypeImports.DBObject], GenTraversableOnce[commons.TypeImports.DBObject], FilterMonadic[commons.TypeImports.DBObject, Iterable[commons.TypeImports.DBObject]], HasNewBuilder[commons.TypeImports.DBObject, Iterable[com.mongodb.casbah.commons.TypeImports.DBObject] @scala.annotation.unchecked.uncheckedVariance], MongoCollectionBase, Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MongoCollection
  2. Iterable
  3. IterableLike
  4. Equals
  5. GenIterable
  6. GenIterableLike
  7. Traversable
  8. GenTraversable
  9. GenericTraversableTemplate
  10. TraversableLike
  11. GenTraversableLike
  12. Parallelizable
  13. TraversableOnce
  14. GenTraversableOnce
  15. FilterMonadic
  16. HasNewBuilder
  17. MongoCollectionBase
  18. Logging
  19. AnyRef
  20. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MongoCollection(underlying: DBCollection)

    Permalink

Type Members

  1. type CursorType = MongoCursor

    Permalink
    Definition Classes
    MongoCollectionMongoCollectionBase
  2. type Self = Iterable[commons.TypeImports.DBObject]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    TraversableLike
  3. type T = DBObject

    Permalink
    Definition Classes
    MongoCollectionMongoCollectionBase
  4. class WithFilter extends FilterMonadic[A, Repr]

    Permalink
    Definition Classes
    TraversableLike

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def ++[B >: commons.TypeImports.DBObject, That](that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[Iterable[commons.TypeImports.DBObject], B, That]): That

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike
  4. def ++:[B >: commons.TypeImports.DBObject, That](that: Traversable[B])(implicit bf: CanBuildFrom[Iterable[commons.TypeImports.DBObject], B, That]): That

    Permalink
    Definition Classes
    TraversableLike
  5. def ++:[B >: commons.TypeImports.DBObject, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Iterable[commons.TypeImports.DBObject], B, That]): That

    Permalink
    Definition Classes
    TraversableLike
  6. def +=[A](x: A)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject): TypeImports.WriteResult

    Permalink

    Save an object to the Collection

    Save an object to the Collection

    x

    object to save to the collection

    Definition Classes
    MongoCollectionBase
  7. def -=[A](x: A)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject): TypeImports.WriteResult

    Permalink

    Remove a matching object from the collection

    Remove a matching object from the collection

    x

    object to remove from the collection

    Definition Classes
    MongoCollectionBase
  8. def /:[B](z: B)(op: (B, commons.TypeImports.DBObject) ⇒ B): B

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  9. def :\[B](z: B)(op: (commons.TypeImports.DBObject, B) ⇒ B): B

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  10. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def _newCursor(cursor: DBCursor): MongoCursor

    Permalink

    _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
    MongoCollectionMongoCollectionBase
  12. def _newInstance(collection: DBCollection): MongoCollection

    Permalink

    _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.

    collection

    (DBCollection)

    returns

    (this.type)

    Definition Classes
    MongoCollectionMongoCollectionBase
  13. def _typedValue(dbObj: commons.TypeImports.DBObject): Option[commons.TypeImports.DBObject]

    Permalink
    Attributes
    protected
    Definition Classes
    MongoCollectionMongoCollectionBase
  14. def addOption(option: Int): Unit

    Permalink

    Manipulate Network Options

    Manipulate Network Options

    Definition Classes
    MongoCollectionBase
    See also

    com.mongodb.Bytes

    com.mongodb.Mongo

  15. def addString(b: StringBuilder): StringBuilder

    Permalink
    Definition Classes
    TraversableOnce
  16. def addString(b: StringBuilder, sep: String): StringBuilder

    Permalink
    Definition Classes
    TraversableOnce
  17. def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder

    Permalink
    Definition Classes
    TraversableOnce
  18. def aggregate[B](z: ⇒ B)(seqop: (B, commons.TypeImports.DBObject) ⇒ B, combop: (B, B) ⇒ B): B

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  19. def aggregate[A](pipeline: Iterable[A], options: AggregationOptions, readPreference: ReadPreference)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject): Cursor

    Permalink

    performs an aggregation operation

    performs an aggregation operation

    pipeline

    the aggregation pipeline

    options

    the aggregation options

    readPreference

    The readPreference for the aggregation

    returns

    The aggregation operation's result set

    Definition Classes
    MongoCollectionBase
  20. def aggregate[A](pipeline: Iterable[A], readPreference: ReadPreference)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject): AggregationOutput

    Permalink

    performs an aggregation operation

    performs an aggregation operation

    pipeline

    the aggregation pipeline

    readPreference

    The readPreference for the aggregation

    returns

    The aggregation operation's result set

    Definition Classes
    MongoCollectionBase
  21. def aggregate[A](pipeline: Iterable[A], options: AggregationOptions)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject): Cursor

    Permalink

    performs an aggregation operation

    performs an aggregation operation

    pipeline

    the aggregation pipeline

    options

    the aggregation options

    returns

    The aggregation operation's result set

    Definition Classes
    MongoCollectionBase
  22. def aggregate[A](pipeline: Iterable[A])(implicit arg0: (A) ⇒ commons.TypeImports.DBObject): AggregationOutput

    Permalink

    performs an aggregation operation

    performs an aggregation operation

    pipeline

    the aggregation pipeline

    returns

    The aggregation operation's result set

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

    Permalink
    Definition Classes
    Any
  24. def canEqual(that: Any): Boolean

    Permalink
    Definition Classes
    IterableLike → Equals
  25. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. def collect[B, That](pf: PartialFunction[commons.TypeImports.DBObject, B])(implicit bf: CanBuildFrom[Iterable[commons.TypeImports.DBObject], B, That]): That

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike
  27. def collectFirst[B](pf: PartialFunction[commons.TypeImports.DBObject, B]): Option[B]

    Permalink
    Definition Classes
    TraversableOnce
  28. def collection(n: String): MongoCollection

    Permalink

    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
  29. def companion: GenericCompanion[Iterable]

    Permalink
    Definition Classes
    Iterable → GenIterable → Traversable → GenTraversable → GenericTraversableTemplate
  30. def copyToArray[B >: commons.TypeImports.DBObject](xs: Array[B], start: Int, len: Int): Unit

    Permalink
    Definition Classes
    IterableLike → TraversableLike → TraversableOnce → GenTraversableOnce
  31. def copyToArray[B >: commons.TypeImports.DBObject](xs: Array[B]): Unit

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  32. def copyToArray[B >: commons.TypeImports.DBObject](xs: Array[B], start: Int): Unit

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  33. def copyToBuffer[B >: commons.TypeImports.DBObject](dest: Buffer[B]): Unit

    Permalink
    Definition Classes
    TraversableOnce
  34. def count(p: (commons.TypeImports.DBObject) ⇒ Boolean): Int

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  35. def count[A, B](query: A = MongoDBObject.empty, fields: B = MongoDBObject.empty, limit: Long = 0, skip: Long = 0, readPrefs: ReadPreference = getReadPreference, maxTime: Duration = Duration(0, MILLISECONDS))(implicit arg0: (A) ⇒ commons.TypeImports.DBObject, arg1: (B) ⇒ commons.TypeImports.DBObject): Int

    Permalink
    Definition Classes
    MongoCollectionBase
  36. def createIndex[A](keys: A, name: String, unique: Boolean)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject): Unit

    Permalink

    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

    a document that contains pairs with the name of the field or fields to index and order of the index

    name

    an identifier for the index. If null or empty, the default name will be used.

    unique

    if the index should be unique

    Definition Classes
    MongoCollectionBase
    Exceptions thrown

    MongoException if the operation failed

  37. def createIndex[A](keys: A, name: String)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject): Unit

    Permalink

    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

    a document that contains pairs with the name of the field or fields to index and order of the index

    name

    an identifier for the index. If null or empty, the default name will be used.

    Definition Classes
    MongoCollectionBase
    Exceptions thrown

    MongoException if the operation failed

  38. def createIndex(name: String): Unit

    Permalink

    Forces creation of an ascending index on a field with the default options.

    Forces creation of an ascending index on a field with the default options.

    name

    name of field to index on

    Definition Classes
    MongoCollectionBase
    Exceptions thrown

    MongoException if the operation failed

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

    Permalink

    Creates an index on the field specified, if that index does not already exist.

    Creates an index on the field specified, if that index does not already exist.

    keys

    a document that contains pairs with the name of the field or fields to index and order of the index

    options

    a document that controls the creation of the index.

    Definition Classes
    MongoCollectionBase
  40. def createIndex[A](keys: A)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject): Unit

    Permalink

    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
  41. def customDecoderFactory: Option[DBDecoderFactory]

    Permalink
    Definition Classes
    MongoCollectionBase
  42. def customEncoderFactory: Option[DBEncoderFactory]

    Permalink
    Definition Classes
    MongoCollectionBase
  43. implicit val db: MongoDB

    Permalink

    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
  44. def distinct[A](key: String, query: A = MongoDBObject.empty, readPrefs: ReadPreference = getReadPreference)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject): Buffer[_]

    Permalink

    Find distinct values for a key

    Find distinct values for a key

    A

    The DBObject type

    key

    the key to find the distinct values for

    query

    the query (optional)

    readPrefs

    the com.mongodb.ReadPreference for the operation.

    Definition Classes
    MongoCollectionBase
  45. def drop(n: Int): Iterable[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    IterableLike → TraversableLike → GenTraversableLike
  46. def drop(): Unit

    Permalink

    Drops (deletes) this collection

    Drops (deletes) this collection

    Definition Classes
    MongoCollectionBase
  47. def dropCollection(): Unit

    Permalink

    Drops (deletes) this collection

    Drops (deletes) this collection

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

    Permalink
    Definition Classes
    MongoCollectionBase
  49. def dropIndex[A](keys: A)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject): Unit

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

    Permalink
    Definition Classes
    MongoCollectionBase
  51. def dropIndexes(): Unit

    Permalink

    Drops all indices from this collection

    Drops all indices from this collection

    Definition Classes
    MongoCollectionBase
  52. def dropRight(n: Int): Iterable[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    IterableLike
  53. def dropWhile(p: (commons.TypeImports.DBObject) ⇒ Boolean): Iterable[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike
  54. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  55. def equals(obj: Any): Boolean

    Permalink

    Checks if this collection is equal to another object.

    Checks if this collection is equal to another object.

    obj

    object with which to compare this collection

    returns

    if the two collections are the same object

    Definition Classes
    MongoCollectionBase → AnyRef → Any
  56. def exists(p: (commons.TypeImports.DBObject) ⇒ Boolean): Boolean

    Permalink
    Definition Classes
    IterableLike → TraversableLike → TraversableOnce → GenTraversableOnce
  57. def explainAggregate[A](pipeline: Iterable[A], options: AggregationOptions)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject): Map[String, AnyRef]

    Permalink

    Return the explain plan for the aggregation pipeline.

    Return the explain plan for the aggregation pipeline.

    pipeline

    the aggregation pipeline to explain

    options

    the options to apply to the aggregation

    returns

    the command result. The explain output may change from release to release, so best to simply log this.

    Definition Classes
    MongoCollectionBase
  58. def filter(p: (commons.TypeImports.DBObject) ⇒ Boolean): Iterable[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike
  59. def filterNot(p: (commons.TypeImports.DBObject) ⇒ Boolean): Iterable[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike
  60. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  61. def find(p: (commons.TypeImports.DBObject) ⇒ Boolean): Option[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    IterableLike → TraversableLike → TraversableOnce → GenTraversableOnce
  62. def find[A, B](ref: A, keys: B)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject, arg1: (B) ⇒ commons.TypeImports.DBObject): CursorType

    Permalink

    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
  63. def find[A](ref: A)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject): CursorType

    Permalink

    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
  64. def find(): CursorType

    Permalink

    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
  65. def findAndModify[A, B, C, D](query: A, fields: B, sort: C, remove: Boolean, update: D, returnNew: Boolean, upsert: Boolean, bypassDocumentValidation: Boolean, maxTime: Duration, writeConcern: WriteConcern)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject, arg1: (B) ⇒ commons.TypeImports.DBObject, arg2: (C) ⇒ commons.TypeImports.DBObject, arg3: (D) ⇒ commons.TypeImports.DBObject): Option[T]

    Permalink

    Finds the first document in the query and updates it.

    Finds the first document in the query and updates it.

    query

    query to match

    fields

    fields to be returned

    sort

    sort to apply before picking first document

    remove

    if true, document found will be removed

    update

    update to apply

    returnNew

    if true, the updated document is returned, otherwise the old document is returned (or it would be lost forever)

    upsert

    do upsert (insert if document not present)

    bypassDocumentValidation

    whether to bypass document validation.

    maxTime

    the maximum duration that the server will allow this operation to execute before killing it

    writeConcern

    the write concern to apply to this operation

    Definition Classes
    MongoCollectionBase
    Since

    3.1.0

    Exceptions thrown

    MongoException if the operation failed for some other reason

    WriteConcernException if the write failed due some other failure specific to the update command

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

    Permalink

    Finds the first document in the query and updates it.

    Finds the first document in the query and updates it.

    query

    query to match

    fields

    fields to be returned

    sort

    sort to apply before picking first document

    remove

    if true, document found will be removed

    update

    update to apply

    returnNew

    if true, the updated document is returned, otherwise the old document is returned (or it would be lost forever)

    upsert

    do upsert (insert if document not present)

    bypassDocumentValidation

    whether to bypass document validation.

    maxTime

    the maximum duration that the server will allow this operation to execute before killing it

    Definition Classes
    MongoCollectionBase
    Since

    3.1.0

    Exceptions thrown

    MongoException if the operation failed for some other reason

    WriteConcernException if the write failed due some other failure specific to the update command

    Note

    bypassDocumentValidation requires MongoDB 3.2 or greater

  67. def findAndModify[A, B, C, D](query: A, fields: B, sort: C, remove: Boolean, update: D, returnNew: Boolean, upsert: Boolean, maxTime: Duration, writeConcern: WriteConcern)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject, arg1: (B) ⇒ commons.TypeImports.DBObject, arg2: (C) ⇒ commons.TypeImports.DBObject, arg3: (D) ⇒ commons.TypeImports.DBObject): Option[T]

    Permalink

    Finds the first document in the query and updates it.

    Finds the first document in the query and updates it.

    query

    query to match

    fields

    fields to be returned

    sort

    sort to apply before picking first document

    remove

    if true, document found will be removed

    update

    update to apply

    returnNew

    if true, the updated document is returned, otherwise the old document is returned (or it would be lost forever)

    upsert

    do upsert (insert if document not present)

    maxTime

    the maximum duration that the server will allow this operation to execute before killing it

    writeConcern

    the write concern to apply to this operation

    Definition Classes
    MongoCollectionBase
    Since

    3.1.0

    Exceptions thrown

    MongoException if the operation failed for some other reason

    WriteConcernException if the write failed due some other failure specific to the update command

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

    Permalink

    Finds the first document in the query and updates it.

    Finds the first document in the query and updates it.

    query

    query to match

    fields

    fields to be returned

    sort

    sort to apply before picking first document

    remove

    if true, document found will be removed

    update

    update to apply

    returnNew

    if true, the updated document is returned, otherwise the old document is returned (or it would be lost forever)

    upsert

    do upsert (insert if document not present)

    maxTime

    the maximum duration that the server will allow this operation to execute before killing it

    returns

    the document as it was before the modifications, unless returnNew is true, in which case it returns the document after the changes were made

    Definition Classes
    MongoCollectionBase
  69. def findAndModify[A, B, C, D](query: A, fields: B, sort: C, remove: Boolean, update: D, returnNew: Boolean, upsert: Boolean, writeConcern: WriteConcern)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject, arg1: (B) ⇒ commons.TypeImports.DBObject, arg2: (C) ⇒ commons.TypeImports.DBObject, arg3: (D) ⇒ commons.TypeImports.DBObject): Option[T]

    Permalink

    Atomically modify and return a single document.

    Atomically modify and return a single document. By default, the returned document does not include the modifications made on the update.

    query

    specifies the selection criteria for the modification

    fields

    a subset of fields to return

    sort

    determines which document the operation will modify if the query selects multiple documents

    remove

    when true, removes the selected document

    update

    the modifications to apply

    returnNew

    when true, returns the modified document rather than the original

    upsert

    when true, operation creates a new document if the query returns no documents

    writeConcern

    the write concern to apply to this operation

    returns

    the document as it was before the modifications, unless returnNew is true, in which case it returns the document after the changes were made

    Definition Classes
    MongoCollectionBase
    Since

    3.1.0

    Exceptions thrown

    MongoException if the operation failed for some other reason

    WriteConcernException if the write failed due some other failure specific to the update command

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

    Permalink

    Finds the first document in the query and updates it.

    Finds the first document in the query and updates it.

    query

    query to match

    fields

    fields to be returned

    sort

    sort to apply before picking first document

    remove

    if true, document found will be removed

    update

    update to apply

    returnNew

    if true, the updated document is returned, otherwise the old document is returned (or it would be lost forever)

    upsert

    do upsert (insert if document not present)

    returns

    the document as it was before the modifications, unless returnNew is true, in which case it returns the document after the changes were made

    Definition Classes
    MongoCollectionBase
  71. def findAndModify[A, B, C](query: A, sort: B, update: C)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject, arg1: (B) ⇒ commons.TypeImports.DBObject, arg2: (C) ⇒ commons.TypeImports.DBObject): Option[T]

    Permalink

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

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

    query

    query to match

    sort

    sort to apply before picking first document

    update

    update to apply

    returns

    the old document

    Definition Classes
    MongoCollectionBase
  72. def findAndModify[A, B](query: A, update: B)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject, arg1: (B) ⇒ commons.TypeImports.DBObject): Option[T]

    Permalink

    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.

    query

    query to match

    update

    update to apply

    returns

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

    Definition Classes
    MongoCollectionBase
  73. def findAndRemove[A](query: A)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject): Option[T]

    Permalink

    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
  74. def findOne[A, B, C](o: A = MongoDBObject.empty, fields: B = MongoDBObject.empty, orderBy: C = MongoDBObject.empty, readPrefs: ReadPreference = getReadPreference, maxTime: Duration = Duration(0, MILLISECONDS))(implicit arg0: (A) ⇒ commons.TypeImports.DBObject, arg1: (B) ⇒ commons.TypeImports.DBObject, arg2: (C) ⇒ commons.TypeImports.DBObject): Option[T]

    Permalink

    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

    (optional) fields to return

    orderBy

    (optional) a document whose fields specify the attributes on which to sort the result set.

    readPrefs

    (optional)

    maxTime

    (optional) the maximum duration that the server will allow this operation to execute before killing it

    returns

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

    Definition Classes
    MongoCollectionBase
  75. def findOne(): Option[T]

    Permalink

    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
  76. def findOneByID[B](id: AnyRef, fields: B)(implicit arg0: (B) ⇒ commons.TypeImports.DBObject): Option[T]

    Permalink

    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
  77. def findOneByID(id: AnyRef): Option[T]

    Permalink

    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
  78. def flatMap[B, That](f: (commons.TypeImports.DBObject) ⇒ GenTraversableOnce[B])(implicit bf: CanBuildFrom[Iterable[commons.TypeImports.DBObject], B, That]): That

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike → FilterMonadic
  79. def flatten[B](implicit asTraversable: (commons.TypeImports.DBObject) ⇒ GenTraversableOnce[B]): Iterable[B]

    Permalink
    Definition Classes
    GenericTraversableTemplate
  80. def fold[A1 >: commons.TypeImports.DBObject](z: A1)(op: (A1, A1) ⇒ A1): A1

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  81. def foldLeft[B](z: B)(op: (B, commons.TypeImports.DBObject) ⇒ B): B

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  82. def foldRight[B](z: B)(op: (commons.TypeImports.DBObject, B) ⇒ B): B

    Permalink
    Definition Classes
    IterableLike → TraversableOnce → GenTraversableOnce
  83. def forall(p: (commons.TypeImports.DBObject) ⇒ Boolean): Boolean

    Permalink
    Definition Classes
    IterableLike → TraversableLike → TraversableOnce → GenTraversableOnce
  84. def foreach[U](f: (commons.TypeImports.DBObject) ⇒ U): Unit

    Permalink
    Definition Classes
    IterableLike → TraversableLike → GenTraversableLike → TraversableOnce → GenTraversableOnce → FilterMonadic
  85. def fullName: String

    Permalink

    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
  86. def genericBuilder[B]: Builder[B, Iterable[B]]

    Permalink
    Definition Classes
    GenericTraversableTemplate
  87. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  88. def getCollection(n: String): MongoCollection

    Permalink

    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
  89. def getCount[A, B](query: A = MongoDBObject.empty, fields: B = MongoDBObject.empty, limit: Long = 0, skip: Long = 0, readPrefs: ReadPreference = getReadPreference, maxTime: Duration = Duration(0, MILLISECONDS))(implicit arg0: (A) ⇒ commons.TypeImports.DBObject, arg1: (B) ⇒ commons.TypeImports.DBObject): Int

    Permalink

    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

    specifies the selection criteria

    fields

    this is ignored

    limit

    limit the count to this value

    skip

    number of documents to skip

    readPrefs

    The [ReadPreference] to be used for this operation

    maxTime

    the maximum duration that the server will allow this operation to execute before killing it

    returns

    the number of documents that matches selection criteria

    Definition Classes
    MongoCollectionBase
  90. def getDB: MongoDB

    Permalink

    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
  91. def getFullName: String

    Permalink

    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
  92. def getIndexInfo: Buffer[commons.TypeImports.DBObject]

    Permalink

    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
  93. def getName: String

    Permalink
    Definition Classes
    MongoCollectionBase
  94. def getObjectClass: Class[_]

    Permalink

    Gets the default class for objects in the collection

    Gets the default class for objects in the collection

    returns

    the class

    Definition Classes
    MongoCollectionBase
  95. def getOptions: Int

    Permalink

    Manipulate Network Options

    Manipulate Network Options

    Definition Classes
    MongoCollectionBase
    See also

    com.mongodb.Bytes

    com.mongodb.Mongo

  96. def getReadPreference: ReadPreference

    Permalink

    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 com.mongodb.casbah.ReadPreference for more information.

    Definition Classes
    MongoCollectionBase
  97. def getStats: CommandResult

    Permalink
    Definition Classes
    MongoCollectionBase
  98. def getWriteConcern: WriteConcern

    Permalink

    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

  99. def group[A, B, C](key: A, cond: B, initial: C, reduce: String, finalize: String = null, readPrefs: ReadPreference = getReadPreference)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject, arg1: (B) ⇒ commons.TypeImports.DBObject, arg2: (C) ⇒ commons.TypeImports.DBObject): Iterable[T]

    Permalink

    Applies a group operation

    Applies a group operation

    key

    the key to group { a : true }

    cond

    optional condition on query

    initial

    initial value for first match on a key

    reduce

    javascript reduce function

    finalize

    An optional function that can operate on the result(s) of the reduce function.

    readPrefs

    ReadPreferences for this command

    returns

    The results of the group

    Definition Classes
    MongoCollectionBase
  100. def groupBy[K](f: (commons.TypeImports.DBObject) ⇒ K): Map[K, Iterable[commons.TypeImports.DBObject]]

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike
  101. def grouped(size: Int): Iterator[Iterable[commons.TypeImports.DBObject]]

    Permalink
    Definition Classes
    IterableLike
  102. def hasDefiniteSize: Boolean

    Permalink
    Definition Classes
    TraversableLike → TraversableOnce → GenTraversableOnce
  103. def hashCode(): Int

    Permalink
    Definition Classes
    MongoCollectionBase → AnyRef → Any
  104. def head: T

    Permalink
    Definition Classes
    MongoCollection → IterableLike → GenericTraversableTemplate → TraversableLike → GenTraversableLike
  105. def headOption: Option[T]

    Permalink
    Definition Classes
    MongoCollection → TraversableLike → GenTraversableLike
  106. def hintFields_=[A](docs: List[A])(implicit arg0: (A) ⇒ commons.TypeImports.DBObject): Unit

    Permalink

    Set hint fields for this collection.

    Set hint fields for this collection.

    docs

    a list of DBObjects to be used as hints

    Definition Classes
    MongoCollectionBase
  107. def indexInfo: Buffer[commons.TypeImports.DBObject]

    Permalink

    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
  108. def init: Iterable[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike
  109. def initializeOrderedBulkOperation: BulkWriteOperation

    Permalink

    Creates a builder for an ordered bulk operation.

    Creates a builder for an ordered bulk operation. Write requests included in the bulk operations will be executed in order, and will halt on the first failure.

    returns

    the builder

    Definition Classes
    MongoCollectionBase
    Since

    2.7

  110. def initializeUnorderedBulkOperation: BulkWriteOperation

    Permalink

    Creates a builder for an unordered bulk operation.

    Creates a builder for an unordered bulk operation. Write requests included in the bulk operation will be executed in an undefined order, and all requests will be executed even if some fail.

    returns

    the builder

    Definition Classes
    MongoCollectionBase
    Since

    2.7

  111. def inits: Iterator[Iterable[commons.TypeImports.DBObject]]

    Permalink
    Definition Classes
    TraversableLike
  112. def insert[A](insertOptions: InsertOptions, docs: A*)(implicit dbObjView: (A) ⇒ commons.TypeImports.DBObject): TypeImports.WriteResult

    Permalink

    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

    insertOptions

    the insertOptions

    docs

    array of documents (<% DBObject) to save

    Definition Classes
    MongoCollectionBase
  113. def insert[A](docs: A*)(implicit dbObjView: (A) ⇒ commons.TypeImports.DBObject, concern: WriteConcern = writeConcern, encoder: TypeImports.DBEncoder = ...): TypeImports.WriteResult

    Permalink

    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

    docs

    array of documents (<% DBObject) to save TODO - Wrapper for WriteResult?

    Definition Classes
    MongoCollectionBase
  114. def insert[A](doc: A, concern: WriteConcern)(implicit dbObjView: (A) ⇒ commons.TypeImports.DBObject): TypeImports.WriteResult

    Permalink

    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

    doc

    array of documents (<% DBObject) to save

    concern

    the WriteConcern for the insert

    Definition Classes
    MongoCollectionBase
  115. def internalClass_=[A <: commons.TypeImports.DBObject](path: String, c: Class[A]): Unit

    Permalink
    Definition Classes
    MongoCollectionBase
  116. def isCapped: Boolean

    Permalink
    Definition Classes
    MongoCollectionBase
  117. def isEmpty: Boolean

    Permalink
    Definition Classes
    IterableLike → TraversableLike → TraversableOnce → GenTraversableOnce
  118. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  119. final def isTraversableAgain: Boolean

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike → GenTraversableOnce
  120. def iterator: CursorType

    Permalink
    Definition Classes
    MongoCollection → IterableLike → GenIterableLike → MongoCollectionBase
  121. def last: commons.TypeImports.DBObject

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike
  122. def lastOption: Option[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike
  123. var log: Logger

    Permalink
    Attributes
    protected[com.mongodb.casbah]
    Definition Classes
    Logging
  124. def map[B, That](f: (commons.TypeImports.DBObject) ⇒ B)(implicit bf: CanBuildFrom[Iterable[commons.TypeImports.DBObject], B, That]): That

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike → FilterMonadic
  125. def mapReduce(cmd: map_reduce.MapReduceCommand): MapReduceResult

    Permalink

    mapReduce execute a mapReduce against this collection.

    mapReduce execute a mapReduce against this collection.

    Throws a MongoExecutionTimeoutException if exceeds max duration limit otherwise returns a MapReduceResult

    cmd

    the MapReduceCommand

    Definition Classes
    MongoCollectionBase
  126. def mapReduce(mapFunction: Imports.JSFunction, reduceFunction: Imports.JSFunction, output: Imports.MapReduceOutputTarget, query: Option[commons.TypeImports.DBObject] = None, sort: Option[commons.TypeImports.DBObject] = None, limit: Option[Int] = None, finalizeFunction: Option[Imports.JSFunction] = None, jsScope: Option[commons.TypeImports.DBObject] = None, verbose: Boolean = false, maxTime: Option[Duration] = None): MapReduceResult

    Permalink

    mapReduce execute a mapReduce against this collection.

    mapReduce execute a mapReduce against this collection.

    mapFunction

    the map function (JSFunction is just a type alias for String)

    reduceFunction

    the reduce function (JSFunction is just a type alias for String)

    output

    the location of the result of the map-reduce operation, defaults to inline. You can output to a collection, output to a collection with an action, or output inline.

    query

    (optional) the selection criteria for the documents input to the map function.

    sort

    (optional) the input documents, useful for optimization.

    limit

    (optional) the maximum number of documents to return from the collection before map reduce

    finalizeFunction

    (optional) the finalize function (JSFunction is just a type alias for String)

    jsScope

    (optional) global variables that are accessible in the map, reduce and finalize functions

    verbose

    (optional) include the timing information in the result information

    maxTime

    (optional) the maximum duration that the server will allow this operation to execute before killing it

    Definition Classes
    MongoCollectionBase
  127. def max[B >: commons.TypeImports.DBObject](implicit cmp: Ordering[B]): commons.TypeImports.DBObject

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  128. def maxBy[B](f: (commons.TypeImports.DBObject) ⇒ B)(implicit cmp: Ordering[B]): commons.TypeImports.DBObject

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  129. def min[B >: commons.TypeImports.DBObject](implicit cmp: Ordering[B]): commons.TypeImports.DBObject

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  130. def minBy[B](f: (commons.TypeImports.DBObject) ⇒ B)(implicit cmp: Ordering[B]): commons.TypeImports.DBObject

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  131. def mkString: String

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  132. def mkString(sep: String): String

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  133. def mkString(start: String, sep: String, end: String): String

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  134. def name: String

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

    Permalink
    Definition Classes
    AnyRef
  136. def newBuilder: Builder[commons.TypeImports.DBObject, Iterable[commons.TypeImports.DBObject]]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    GenericTraversableTemplate → HasNewBuilder
  137. def nonEmpty: Boolean

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  138. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  139. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  140. def objectClass: Class[_]

    Permalink

    Gets the default class for objects in the collection

    Gets the default class for objects in the collection

    returns

    the class

    Definition Classes
    MongoCollectionBase
  141. def objectClass_=[A <: commons.TypeImports.DBObject](c: Class[A])(implicit arg0: Manifest[A]): MongoGenericTypedCollection[A]

    Permalink

    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
  142. def options: Int

    Permalink

    Manipulate Network Options

    Manipulate Network Options

    Definition Classes
    MongoCollectionBase
    See also

    com.mongodb.Bytes

    com.mongodb.Mongo

  143. def par: ParIterable[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    Parallelizable
  144. def parCombiner: Combiner[commons.TypeImports.DBObject, ParIterable[commons.TypeImports.DBObject]]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    TraversableLike → Parallelizable
  145. def parallelScan(options: ParallelScanOptions): Buffer[Cursor]

    Permalink

    Return a list of cursors over the collection that can be used to scan it in parallel.

    Return a list of cursors over the collection that can be used to scan it in parallel.

    Note: As of MongoDB 2.6, this method will work against a mongod, but not a mongos.

    options

    the parallel scan options

    returns

    a list of cursors, whose size may be less than the number requested

    Definition Classes
    MongoCollectionBase
    Since

    2.7

  146. def partition(p: (commons.TypeImports.DBObject) ⇒ Boolean): (Iterable[commons.TypeImports.DBObject], Iterable[commons.TypeImports.DBObject])

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike
  147. def product[B >: commons.TypeImports.DBObject](implicit num: Numeric[B]): B

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  148. def readPreference: ReadPreference

    Permalink

    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 com.mongodb.casbah.ReadPreference for more information.

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

    Permalink

    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 com.mongodb.casbah.ReadPreference for more information.

    pref

    Read Preference to use

    Definition Classes
    MongoCollectionBase
  150. def reduce[A1 >: commons.TypeImports.DBObject](op: (A1, A1) ⇒ A1): A1

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  151. def reduceLeft[B >: commons.TypeImports.DBObject](op: (B, commons.TypeImports.DBObject) ⇒ B): B

    Permalink
    Definition Classes
    TraversableOnce
  152. def reduceLeftOption[B >: commons.TypeImports.DBObject](op: (B, commons.TypeImports.DBObject) ⇒ B): Option[B]

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  153. def reduceOption[A1 >: commons.TypeImports.DBObject](op: (A1, A1) ⇒ A1): Option[A1]

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  154. def reduceRight[B >: commons.TypeImports.DBObject](op: (commons.TypeImports.DBObject, B) ⇒ B): B

    Permalink
    Definition Classes
    IterableLike → TraversableOnce → GenTraversableOnce
  155. def reduceRightOption[B >: commons.TypeImports.DBObject](op: (commons.TypeImports.DBObject, B) ⇒ B): Option[B]

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  156. def remove[A](o: A, concern: WriteConcern = getWriteConcern)(implicit dbObjView: (A) ⇒ commons.TypeImports.DBObject, encoder: TypeImports.DBEncoder = ...): TypeImports.WriteResult

    Permalink

    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
  157. def rename(newName: String, dropTarget: Boolean): MongoCollection

    Permalink

    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
  158. def rename(newName: String): MongoCollection

    Permalink

    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
  159. def repr: Iterable[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike
  160. def resetOptions(): Unit

    Permalink

    Manipulate Network Options

    Manipulate Network Options

    Definition Classes
    MongoCollectionBase
    See also

    com.mongodb.Bytes

    com.mongodb.Mongo

  161. def reversed: List[commons.TypeImports.DBObject]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    TraversableOnce
  162. def sameElements[B >: commons.TypeImports.DBObject](that: GenIterable[B]): Boolean

    Permalink
    Definition Classes
    IterableLike → GenIterableLike
  163. def save[A](o: A, concern: WriteConcern = getWriteConcern)(implicit dbObjView: (A) ⇒ commons.TypeImports.DBObject): TypeImports.WriteResult

    Permalink

    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
  164. def scan[B >: commons.TypeImports.DBObject, That](z: B)(op: (B, B) ⇒ B)(implicit cbf: CanBuildFrom[Iterable[commons.TypeImports.DBObject], B, That]): That

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike
  165. def scanLeft[B, That](z: B)(op: (B, commons.TypeImports.DBObject) ⇒ B)(implicit bf: CanBuildFrom[Iterable[commons.TypeImports.DBObject], B, That]): That

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike
  166. def scanRight[B, That](z: B)(op: (commons.TypeImports.DBObject, B) ⇒ B)(implicit bf: CanBuildFrom[Iterable[commons.TypeImports.DBObject], B, That]): That

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike
    Annotations
    @migration
    Migration

    (Changed in version 2.9.0) The behavior of scanRight has changed. The previous behavior can be reproduced with scanRight.reverse.

  167. def seq: Iterable[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    Iterable → GenIterable → Traversable → GenTraversable → Parallelizable → TraversableOnce → GenTraversableOnce
  168. def setHintFields[A](docs: List[A])(implicit arg0: (A) ⇒ commons.TypeImports.DBObject): Unit

    Permalink

    Set hint fields for this collection.

    Set hint fields for this collection.

    docs

    a list of DBObjects to be used as hints

    Definition Classes
    MongoCollectionBase
  169. def setInternalClass[A <: commons.TypeImports.DBObject](path: String, c: Class[A]): Unit

    Permalink
    Definition Classes
    MongoCollectionBase
  170. def setObjectClass[A <: commons.TypeImports.DBObject](c: Class[A])(implicit arg0: Manifest[A]): MongoGenericTypedCollection[A]

    Permalink

    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
  171. def setReadPreference(pref: ReadPreference): Unit

    Permalink

    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 com.mongodb.casbah.ReadPreference for more information.

    pref

    Read Preference to use

    Definition Classes
    MongoCollectionBase
  172. def setWriteConcern(concern: WriteConcern): Unit

    Permalink

    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

  173. def size: Int

    Permalink
    Definition Classes
    MongoCollection → GenTraversableLike → TraversableOnce → GenTraversableOnce
  174. def slice(from: Int, until: Int): Iterable[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    IterableLike → TraversableLike → GenTraversableLike
  175. def sliding(size: Int, step: Int): Iterator[Iterable[commons.TypeImports.DBObject]]

    Permalink
    Definition Classes
    IterableLike
  176. def sliding(size: Int): Iterator[Iterable[commons.TypeImports.DBObject]]

    Permalink
    Definition Classes
    IterableLike
  177. def span(p: (commons.TypeImports.DBObject) ⇒ Boolean): (Iterable[commons.TypeImports.DBObject], Iterable[commons.TypeImports.DBObject])

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike
  178. def splitAt(n: Int): (Iterable[commons.TypeImports.DBObject], Iterable[commons.TypeImports.DBObject])

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike
  179. def stats: CommandResult

    Permalink
    Definition Classes
    MongoCollectionBase
  180. def stringPrefix: String

    Permalink
    Definition Classes
    TraversableLike → GenTraversableLike
  181. def sum[B >: commons.TypeImports.DBObject](implicit num: Numeric[B]): B

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  182. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  183. def tail: Iterable[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    MongoCollection → TraversableLike → GenTraversableLike
  184. def tails: Iterator[Iterable[commons.TypeImports.DBObject]]

    Permalink
    Definition Classes
    TraversableLike
  185. def take(n: Int): Iterable[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    IterableLike → TraversableLike → GenTraversableLike
  186. def takeRight(n: Int): Iterable[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    IterableLike
  187. def takeWhile(p: (commons.TypeImports.DBObject) ⇒ Boolean): Iterable[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    IterableLike → TraversableLike → GenTraversableLike
  188. def thisCollection: Iterable[commons.TypeImports.DBObject]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    IterableLike → TraversableLike
  189. def to[Col[_]](implicit cbf: CanBuildFrom[Nothing, commons.TypeImports.DBObject, Col[commons.TypeImports.DBObject]]): Col[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    TraversableLike → TraversableOnce → GenTraversableOnce
  190. def toArray[B >: commons.TypeImports.DBObject](implicit arg0: ClassTag[B]): Array[B]

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  191. def toBuffer[B >: commons.TypeImports.DBObject]: Buffer[B]

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  192. def toCollection(repr: Iterable[commons.TypeImports.DBObject]): Iterable[commons.TypeImports.DBObject]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    IterableLike → TraversableLike
  193. def toIndexedSeq: IndexedSeq[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  194. def toIterable: Iterable[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    IterableLike → TraversableOnce → GenTraversableOnce
  195. def toIterator: Iterator[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    IterableLike → TraversableLike → GenTraversableOnce
    Annotations
    @deprecatedOverriding( ... , "2.11.0" )
  196. def toList: List[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  197. def toMap[T, U](implicit ev: <:<[commons.TypeImports.DBObject, (T, U)]): Map[T, U]

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  198. def toSeq: Seq[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  199. def toSet[B >: commons.TypeImports.DBObject]: Set[B]

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  200. def toStream: Stream[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    IterableLike → TraversableLike → GenTraversableOnce
  201. def toString(): String

    Permalink
    Definition Classes
    MongoCollection → TraversableLike → MongoCollectionBase → AnyRef → Any
  202. def toTraversable: Traversable[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    TraversableLike → TraversableOnce → GenTraversableOnce
    Annotations
    @deprecatedOverriding( ... , "2.11.0" )
  203. def toVector: Vector[commons.TypeImports.DBObject]

    Permalink
    Definition Classes
    TraversableOnce → GenTraversableOnce
  204. def transpose[B](implicit asTraversable: (commons.TypeImports.DBObject) ⇒ GenTraversableOnce[B]): Iterable[Iterable[B]]

    Permalink
    Definition Classes
    GenericTraversableTemplate
    Annotations
    @migration
    Migration

    (Changed in version 2.9.0) transpose throws an IllegalArgumentException if collections are not uniformly sized.

  205. val underlying: DBCollection

    Permalink

    The underlying Java Mongo Driver Collection object we proxy.

    The underlying Java Mongo Driver Collection object we proxy.

    Definition Classes
    MongoCollectionMongoCollectionBase
  206. def unzip[A1, A2](implicit asPair: (commons.TypeImports.DBObject) ⇒ (A1, A2)): (Iterable[A1], Iterable[A2])

    Permalink
    Definition Classes
    GenericTraversableTemplate
  207. def unzip3[A1, A2, A3](implicit asTriple: (commons.TypeImports.DBObject) ⇒ (A1, A2, A3)): (Iterable[A1], Iterable[A2], Iterable[A3])

    Permalink
    Definition Classes
    GenericTraversableTemplate
  208. def update[A, B](q: A, o: B, upsert: Boolean = false, multi: Boolean = false, concern: WriteConcern = this.writeConcern, bypassDocumentValidation: Option[Boolean] = None)(implicit queryView: (A) ⇒ commons.TypeImports.DBObject, objView: (B) ⇒ commons.TypeImports.DBObject, encoder: TypeImports.DBEncoder = ...): TypeImports.WriteResult

    Permalink

    Performs an update operation.

    Performs an update operation.

    q

    search query for old object to update

    o

    object with which to update q

    Definition Classes
    MongoCollectionBase
  209. def view(from: Int, until: Int): IterableView[commons.TypeImports.DBObject, Iterable[commons.TypeImports.DBObject]]

    Permalink
    Definition Classes
    IterableLike → TraversableLike
  210. def view: IterableView[commons.TypeImports.DBObject, Iterable[commons.TypeImports.DBObject]]

    Permalink
    Definition Classes
    IterableLike → TraversableLike
  211. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  214. def withFilter(p: (commons.TypeImports.DBObject) ⇒ Boolean): FilterMonadic[commons.TypeImports.DBObject, Iterable[commons.TypeImports.DBObject]]

    Permalink
    Definition Classes
    TraversableLike → FilterMonadic
  215. def writeConcern: WriteConcern

    Permalink

    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

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

    Permalink

    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

  217. def zip[A1 >: commons.TypeImports.DBObject, B, That](that: GenIterable[B])(implicit bf: CanBuildFrom[Iterable[commons.TypeImports.DBObject], (A1, B), That]): That

    Permalink
    Definition Classes
    IterableLike → GenIterableLike
  218. def zipAll[B, A1 >: commons.TypeImports.DBObject, That](that: GenIterable[B], thisElem: A1, thatElem: B)(implicit bf: CanBuildFrom[Iterable[commons.TypeImports.DBObject], (A1, B), That]): That

    Permalink
    Definition Classes
    IterableLike → GenIterableLike
  219. def zipWithIndex[A1 >: commons.TypeImports.DBObject, That](implicit bf: CanBuildFrom[Iterable[commons.TypeImports.DBObject], (A1, Int), That]): That

    Permalink
    Definition Classes
    IterableLike → GenIterableLike

Deprecated Value Members

  1. def aggregate(pipeline: commons.TypeImports.DBObject*): AggregationOutput

    Permalink

    performs an aggregation operation

    performs an aggregation operation

    pipeline

    the aggregation pipeline

    returns

    The aggregation operation's result set

    Definition Classes
    MongoCollectionBase
    Annotations
    @deprecated
    Deprecated

    (Since version 2.7) Use aggregate(List(DBObject) instead

  2. def find[A, B](ref: A, fields: B, numToSkip: Int, batchSize: Int)(implicit arg0: (A) ⇒ commons.TypeImports.DBObject, arg1: (B) ⇒ commons.TypeImports.DBObject): CursorType

    Permalink

    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
    Annotations
    @deprecated
    Deprecated

    (Since version 2.7) Use find().skip().batchSize().

  3. def slaveOk(): Unit

    Permalink

    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 @SuppressWarnings()
    Deprecated

    (Since version 2.3.0) Replaced with ReadPreference.SECONDARY

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

    Permalink

    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 Iterable[commons.TypeImports.DBObject]

Inherited from IterableLike[commons.TypeImports.DBObject, Iterable[commons.TypeImports.DBObject]]

Inherited from Equals

Inherited from GenIterable[commons.TypeImports.DBObject]

Inherited from GenIterableLike[commons.TypeImports.DBObject, Iterable[commons.TypeImports.DBObject]]

Inherited from Traversable[commons.TypeImports.DBObject]

Inherited from GenTraversable[commons.TypeImports.DBObject]

Inherited from GenericTraversableTemplate[commons.TypeImports.DBObject, Iterable]

Inherited from TraversableLike[commons.TypeImports.DBObject, Iterable[commons.TypeImports.DBObject]]

Inherited from GenTraversableLike[commons.TypeImports.DBObject, Iterable[commons.TypeImports.DBObject]]

Inherited from Parallelizable[commons.TypeImports.DBObject, ParIterable[commons.TypeImports.DBObject]]

Inherited from TraversableOnce[commons.TypeImports.DBObject]

Inherited from GenTraversableOnce[commons.TypeImports.DBObject]

Inherited from FilterMonadic[commons.TypeImports.DBObject, Iterable[commons.TypeImports.DBObject]]

Inherited from HasNewBuilder[commons.TypeImports.DBObject, Iterable[com.mongodb.casbah.commons.TypeImports.DBObject] @scala.annotation.unchecked.uncheckedVariance]

Inherited from MongoCollectionBase

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped