Trait/Object

io.scalajs.npm.mongodb

Collection

Related Docs: object Collection | package mongodb

Permalink

trait Collection extends Object

Mongo Collection

Annotations
@RawJSType() @native()
See also

http://mongodb.github.io/node-mongodb-native/2.1/api/index.html

Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Collection
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def aggregate[A <: Any](pipeline: Array[_ <: Any], options: |[AggregationOptions, RawOptions] = js.native): AggregationCursor[A]

    Permalink

    Execute an aggregation framework pipeline against the collection, needs MongoDB >= 2.2

    Execute an aggregation framework pipeline against the collection, needs MongoDB >= 2.2

    pipeline

    Array containing all the aggregation framework commands for the execution.

    Example:
    1. aggregate(pipeline, options, callback)

  5. def aggregate[A <: Any](pipeline: Array[_ <: Any], callback: MongoCallback[Array[A]]): Unit

    Permalink

    Execute an aggregation framework pipeline against the collection, needs MongoDB >= 2.2

    Execute an aggregation framework pipeline against the collection, needs MongoDB >= 2.2

    pipeline

    Array containing all the aggregation framework commands for the execution.

    callback

    The command result callback

    Example:
    1. aggregate(pipeline, options, callback)

  6. def aggregate[A <: Any](pipeline: Array[_ <: Any], options: AggregationOptions, callback: MongoCallback[Array[A]]): Unit

    Permalink

    Execute an aggregation framework pipeline against the collection, needs MongoDB >= 2.2

    Execute an aggregation framework pipeline against the collection, needs MongoDB >= 2.2

    pipeline

    Array containing all the aggregation framework commands for the execution.

    options

    Optional settings.

    callback

    The command result callback

    Example:
    1. aggregate(pipeline, options, callback)

  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def bulkWrite(operations: Array[Any], options: RawOptions = js.native): Promise[BulkWriteOpResultObject]

    Permalink

    Perform a bulkWrite operation without a fluent API

    Perform a bulkWrite operation without a fluent API

    operations

    Bulk operations to perform.

    options

    Optional settings.

    Example:
    1. bulkWrite(operations, options, callback)

  9. def bulkWrite[A <: Any](operations: Array[A], callback: MongoCallback[BulkWriteOpResultObject]): Unit

    Permalink

    Perform a bulkWrite operation without a fluent API

    Perform a bulkWrite operation without a fluent API

    operations

    Bulk operations to perform.

    callback

    The command result callback

    Example:
    1. bulkWrite(operations, options, callback)

  10. def bulkWrite[A <: Any](operations: Array[A], options: RawOptions, callback: MongoCallback[BulkWriteOpResultObject]): Unit

    Permalink

    Perform a bulkWrite operation without a fluent API

    Perform a bulkWrite operation without a fluent API

    operations

    Bulk operations to perform.

    options

    Optional settings.

    callback

    The command result callback

    Example:
    1. bulkWrite(operations, options, callback)

  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def count(query: Any, options: RawOptions = null): Promise[Int]

    Permalink

    Count number of matching documents in the db to a query.

    Count number of matching documents in the db to a query.

    query

    The query for the count.

    options

    Optional settings.

    Example:
    1. count(query, options, callback)

  13. def count(query: Any, options: RawOptions, callback: Function2[MongoError, Int, Any]): Unit

    Permalink

    Count number of matching documents in the db to a query.

    Count number of matching documents in the db to a query.

    query

    The query for the count.

    options

    Optional settings.

    callback

    The command result callback

    Example:
    1. count(query, options, callback)

  14. def createIndex(fieldOrSpec: Any, options: |[IndexOptions, RawOptions] = js.native): Promise[String]

    Permalink

    Creates an index on the db and collection collection.

    Creates an index on the db and collection collection.

    fieldOrSpec

    Defines the index.

    options

    Optional settings.

    Example:
    1. createIndex(fieldOrSpec, options[, callback])

  15. def createIndex(fieldOrSpec: Any, callback: Function2[MongoError, String, Any]): Unit

    Permalink

    Creates an index on the db and collection collection.

    Creates an index on the db and collection collection.

    fieldOrSpec

    Defines the index.

    callback

    The command result callback

    Example:
    1. createIndex(fieldOrSpec, options[, callback])

  16. def createIndex(fieldOrSpec: Any, options: |[IndexOptions, RawOptions], callback: Function2[MongoError, String, Any]): Unit

    Permalink

    Creates an index on the db and collection collection.

    Creates an index on the db and collection collection.

    fieldOrSpec

    Defines the index.

    options

    Optional settings.

    callback

    The command result callback

    Example:
    1. createIndex(fieldOrSpec, options[, callback])

  17. def createIndexes(indexSpecs: Array[Any], callback: Function): Unit

    Permalink

    Creates multiple indexes in the collection, this method is only supported for MongoDB 2.6 or higher.

    Creates multiple indexes in the collection, this method is only supported for MongoDB 2.6 or higher. Earlier version of MongoDB will throw a command not supported error. Index specifications are defined at

    http://docs.mongodb.org/manual/reference/command/createIndexes/

    . http://docs.mongodb.org/manual/reference/command/createIndexes/ }}}

    indexSpecs

    An array of index specifications to be created

    callback

    The command result callback

    Example:
    1. createIndexes(indexSpecs, callback)

  18. def deleteMany(filter: Any, options: |[DeleteOptions, RawOptions] = js.native): Promise[DeleteWriteOpResult]

    Permalink

    Delete multiple documents on MongoDB

    Delete multiple documents on MongoDB

    filter

    The Filter used to select the documents to remove

    options

    Optional settings.

    Example:
    1. deleteMany(filter, options, callback)

  19. def deleteMany(filter: Any, callback: MongoCallback[DeleteWriteOpResult]): Unit

    Permalink

    Delete multiple documents on MongoDB

    Delete multiple documents on MongoDB

    filter

    The Filter used to select the documents to remove

    callback

    The command result callback

    Example:
    1. deleteMany(filter, options, callback)

  20. def deleteMany(filter: Any, options: DeleteOptions, callback: MongoCallback[DeleteWriteOpResult]): Unit

    Permalink

    Delete multiple documents on MongoDB

    Delete multiple documents on MongoDB

    filter

    The Filter used to select the documents to remove

    options

    Optional settings.

    callback

    The command result callback

    Example:
    1. deleteMany(filter, options, callback)

  21. def deleteOne(filter: Any, options: RawOptions = js.native): Promise[DeleteWriteOpResult]

    Permalink

    Delete a document on MongoDB

    Delete a document on MongoDB

    filter

    The Filter used to select the document to remove

    options

    Optional settings.

  22. def deleteOne(filter: Any, callback: Function): Unit

    Permalink

    Delete a document on MongoDB

    Delete a document on MongoDB

    filter

    The Filter used to select the document to remove

    callback

    The command result callback

  23. def deleteOne(filter: Any, options: RawOptions, callback: Function): Unit

    Permalink

    Delete a document on MongoDB

    Delete a document on MongoDB

    filter

    The Filter used to select the document to remove

    options

    Optional settings.

    callback

    The command result callback

  24. def distinct(key: Any, query: Any, options: RawOptions, callback: Function): Unit

    Permalink

    The distinct command returns returns a list of distinct values for the given key across a collection.

    The distinct command returns returns a list of distinct values for the given key across a collection.

    key

    Field of the document to find distinct values for.

    query

    The query for filtering the set of documents to which we apply the distinct filter.

    options

    Optional settings.

    callback

    The command result callback

    Example:
    1. distinct(key, query, options, callback)

  25. def drop(): Promise[Any]

    Permalink

    Drop the collection from the database, removing it permanently.

    Drop the collection from the database, removing it permanently. New accesses will create a new collection.

    Example:
    1. drop(callback)

  26. def drop(callback: Function1[MongoError, Any]): Unit

    Permalink

    Drop the collection from the database, removing it permanently.

    Drop the collection from the database, removing it permanently. New accesses will create a new collection.

    callback

    The command result callback

    Example:
    1. drop(callback)

  27. def dropIndex(indexName: String, options: RawOptions, callback: Function): Unit

    Permalink

    Drops an index from this collection.

    Drops an index from this collection.

    indexName

    Name of the index to drop.

    options

    Optional settings.

    callback

    The command result callback

    Example:
    1. dropIndex(indexName, options, callback)

  28. def dropIndexes(callback: Function): Unit

    Permalink

    Drops all indexes from this collection.

    Drops all indexes from this collection.

    callback

    The command result callback

    Example:
    1. dropIndexes(callback)

  29. def ensureIndex(fieldOrSpec: Any, options: |[IndexOptions, RawOptions]): Promise[Any]

    Permalink

    Ensures that an index exists, if it does not it creates it

    Ensures that an index exists, if it does not it creates it

    fieldOrSpec

    Defines the index.

    options

    Optional settings.

    returns

    ????

    Example:
    1. ensureIndex(fieldOrSpec, options)

  30. def ensureIndex(fieldOrSpec: Any, options: |[IndexOptions, RawOptions], callback: Function): Unit

    Permalink

    Ensures that an index exists, if it does not it creates it

    Ensures that an index exists, if it does not it creates it

    fieldOrSpec

    Defines the index.

    options

    Optional settings.

    callback

    The command result callback

    Example:
    1. ensureIndex(fieldOrSpec, options, callback)

  31. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  32. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  33. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  34. def find[T](selector: Any, projection: Any): Cursor[T]

    Permalink

    Creates a cursor for a query that can be used to iterate over results from MongoDB

    Creates a cursor for a query that can be used to iterate over results from MongoDB

    Example:
    1. find([selector[, projection]])
  35. def find[T](selector: Any): Cursor[T]

    Permalink

    Creates a cursor for a query that can be used to iterate over results from MongoDB

    Creates a cursor for a query that can be used to iterate over results from MongoDB

    Example:
    1. find([selector[, projection]])
  36. def find[T](): Cursor[T]

    Permalink

    Creates a cursor for a query that can be used to iterate over results from MongoDB

    Creates a cursor for a query that can be used to iterate over results from MongoDB

    Example:
    1. find([selector[, projection]])
  37. def findAndRemove[T](query: Any, sort: Array[Any], options: RawOptions): Promise[T]

    Permalink

    Find and remove a document.

    Find and remove a document.

    query

    Query object to locate the object to modify.

    sort

    If multiple docs match, choose the first one in the specified sort order as the object to manipulate.

    options

    Optional settings.

    Example:
    1. findAndRemove(query, sort, options, callback)

  38. def findAndRemove(query: Any, sort: Array[Any], options: RawOptions, callback: Function): Unit

    Permalink

    Find and remove a document.

    Find and remove a document.

    query

    Query object to locate the object to modify.

    sort

    If multiple docs match, choose the first one in the specified sort order as the object to manipulate.

    options

    Optional settings.

    callback

    The command result callback

    Example:
    1. findAndRemove(query, sort, options, callback)

  39. def findOneAndDelete(filter: Any, callback: Function): Unit

    Permalink

    Find a document and delete it in one atomic operation, requires a write lock for the duration of the operation.

    Find a document and delete it in one atomic operation, requires a write lock for the duration of the operation.

    filter

    Document selection filter.

    callback

    The command result callback

    Example:
    1. findOneAndDelete(filter[, options], callback)

  40. def findOneAndDelete(filter: Any, options: RawOptions, callback: Function): Unit

    Permalink

    Find a document and delete it in one atomic operation, requires a write lock for the duration of the operation.

    Find a document and delete it in one atomic operation, requires a write lock for the duration of the operation.

    filter

    Document selection filter.

    options

    Optional settings.

    callback

    The command result callback

    Example:
    1. findOneAndDelete(filter[, options], callback)

  41. def findOneAndReplace(filter: Any, replacement: Any, options: RawOptions, callback: Function): Unit

    Permalink

    Find a document and replace it in one atomic operation, requires a write lock for the duration of the operation.

    Find a document and replace it in one atomic operation, requires a write lock for the duration of the operation.

    filter

    Document selection filter.

    replacement

    Document replacing the matching document.

    options

    Optional settings.

    callback

    The command result callback

    Example:
    1. findOneAndReplace(filter, replacement, options, callback)

  42. def findOneAndUpdate(filter: Any, update: Any, options: FindAndUpdateOptions = null): Promise[FindAndModifyWriteOpResult]

    Permalink

    Find a document and update it in one atomic operation, requires a write lock for the duration of the operation.

    Find a document and update it in one atomic operation, requires a write lock for the duration of the operation.

    filter

    Document selection filter.

    update

    Update operations to be performed on the document

    options

    Optional settings.

    Example:
    1. findOneAndUpdate(filter, update, options, callback)

  43. def findOneAndUpdate(filter: Any, update: Any, callback: Function): Unit

    Permalink

    Find a document and update it in one atomic operation, requires a write lock for the duration of the operation.

    Find a document and update it in one atomic operation, requires a write lock for the duration of the operation.

    filter

    Document selection filter.

    update

    Update operations to be performed on the document

    callback

    The command result callback

    Example:
    1. findOneAndUpdate(filter, update, options, callback)

  44. def findOneAndUpdate(filter: Any, update: Any, options: FindAndUpdateOptions, callback: Function): Unit

    Permalink

    Find a document and update it in one atomic operation, requires a write lock for the duration of the operation.

    Find a document and update it in one atomic operation, requires a write lock for the duration of the operation.

    filter

    Document selection filter.

    update

    Update operations to be performed on the document

    options

    Optional settings.

    callback

    The command result callback

    Example:
    1. findOneAndUpdate(filter, update, options, callback)

  45. def geoHaystackSearch(x: Double, y: Double, options: RawOptions, callback: Function): Unit

    Permalink

    Execute a geo search using a geo haystack index on a collection.

    Execute a geo search using a geo haystack index on a collection.

    x

    Point to search on the x axis, ensure the indexes are ordered in the same order.

    y

    Point to search on the y axis, ensure the indexes are ordered in the same order.

    options

    Optional settings.

    callback

    The command result callback

  46. def geoNear(x: Double, y: Double, options: RawOptions, callback: Function): Unit

    Permalink

    Execute the geoNear command to search for items in the collection

    Execute the geoNear command to search for items in the collection

    x

    Point to search on the x axis, ensure the indexes are ordered in the same order.

    y

    Point to search on the y axis, ensure the indexes are ordered in the same order.

    options

    Optional settings.

    callback

    The command result callback

  47. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  48. def group(keys: Any, condition: Any, initial: Any, reduce: Any, finalize: Any, command: Any, options: RawOptions, callback: Function): Unit

    Permalink

    keys

    An object, array or function expressing the keys to group by.

    condition

    An optional condition that must be true for a row to be considered.

    initial

    Initial value of the aggregation counter object.

    reduce

    The reduce function aggregates (reduces) the objects iterated

    finalize

    An optional function to be run on each item in the result set just before the item is returned.

    command

    Specify if you wish to run using the internal group command or using eval, default is true.

    options

    Optional settings

    callback

    The command result callback

    Example:
    1. group(keys, condition, initial, reduce, finalize, command, options, callback)

  49. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  50. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  51. def indexExists(indexes: String): Promise[Boolean]

    Permalink

    Checks if one or more indexes exist on the collection, fails on first non-existing index

    Checks if one or more indexes exist on the collection, fails on first non-existing index

    indexes

    One or more index names to check.

    returns

    Promise if no callback passed

    Example:
    1. indexExists(indexes, callback)

  52. def indexExists(indexes: String, callback: MongoCallback[Boolean]): Unit

    Permalink

    Checks if one or more indexes exist on the collection, fails on first non-existing index

    Checks if one or more indexes exist on the collection, fails on first non-existing index

    indexes

    One or more index names to check.

    callback

    The command result callback

    returns

    Promise if no callback passed

    Example:
    1. indexExists(indexes, callback)

  53. def indexExists(indexes: Array[String]): Promise[Boolean]

    Permalink

    Checks if one or more indexes exist on the collection, fails on first non-existing index

    Checks if one or more indexes exist on the collection, fails on first non-existing index

    indexes

    One or more index names to check.

    returns

    Promise if no callback passed

    Example:
    1. indexExists(indexes, callback)

  54. def indexExists(indexes: Array[String], callback: MongoCallback[Boolean]): Unit

    Permalink

    Checks if one or more indexes exist on the collection, fails on first non-existing index

    Checks if one or more indexes exist on the collection, fails on first non-existing index

    indexes

    One or more index names to check.

    callback

    The command result callback

    returns

    Promise if no callback passed

    Example:
    1. indexExists(indexes, callback)

  55. def indexInformation(options: RawOptions, callback: Function): Unit

    Permalink

    Retrieves this collections index info.

    Retrieves this collections index info.

    options

    Optional settings.

    callback

    The command result callback

    Example:
    1. indexInformation(options, callback)

  56. def indexes(callback: Function): Unit

    Permalink

    Retrieve all the indexes on the collection.

    Retrieve all the indexes on the collection.

    callback

    The command result callback

    Example:
    1. indexes(callback)

  57. def initializeOrderedBulkOp(options: RawOptions, callback: Function): Unit

    Permalink

    Initiate an In order bulk write operation, operations will be serially executed in the order they are added, creating a new operation for each switch in types.

    Initiate an In order bulk write operation, operations will be serially executed in the order they are added, creating a new operation for each switch in types.

    options

    Optional settings.

    callback

    The command result callback

    Example:
    1. initializeOrderedBulkOp(options, callback)

  58. def initializeUnorderedBulkOp(options: RawOptions = js.native): Unit

    Permalink

    Initiate a Out of order batch write operation.

    Initiate a Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order.

    options

    Optional settings.

    Example:
    1. initializeUnorderedBulkOp(options)

  59. def insert(doc: Any, options: |[WriteOptions, RawOptions], callback: MongoCallback[InsertWriteOpResult]): Unit

    Permalink

    Inserts a single document or a an array of documents into MongoDB.

    Inserts a single document or a an array of documents into MongoDB. If documents passed in do not contain the _id field, one will be added to each of the documents missing it by the driver, mutating the document. This behavior can be overridden by setting the forceServerObjectId flag.

    doc

    Document to insert.

    callback

    The command result callback

  60. def insert(doc: Any, callback: MongoCallback[InsertWriteOpResult]): Unit

    Permalink

    Inserts a single document or a an array of documents into MongoDB.

    Inserts a single document or a an array of documents into MongoDB. If documents passed in do not contain the _id field, one will be added to each of the documents missing it by the driver, mutating the document. This behavior can be overridden by setting the forceServerObjectId flag.

    doc

    Document to insert.

  61. def insert(doc: Any): Promise[InsertWriteOpResult]

    Permalink

    Inserts a single document or a an array of documents into MongoDB.

    Inserts a single document or a an array of documents into MongoDB. If documents passed in do not contain the _id field, one will be added to each of the documents missing it by the driver, mutating the document. This behavior can be overridden by setting the forceServerObjectId flag.

    doc

    the given document

  62. def insertMany[T <: Any](docs: Array[T], options: |[WriteOptions, RawOptions] = js.native): Promise[InsertWriteOpResult]

    Permalink

    Inserts an array of documents into MongoDB.

    Inserts an array of documents into MongoDB. If documents passed in do not contain the _id field, one will be added to each of the documents missing it by the driver, mutating the document. This behavior can be overridden by setting the forceServerObjectId flag.

    docs

    Documents to insert.

    options

    Optional settings.

    Example:
    1. insertMany(docs, options, callback): Promise

  63. def insertMany[T <: Any](docs: Array[T], callback: MongoCallback[InsertWriteOpResult]): Unit

    Permalink

    Inserts an array of documents into MongoDB.

    Inserts an array of documents into MongoDB. If documents passed in do not contain the _id field, one will be added to each of the documents missing it by the driver, mutating the document. This behavior can be overridden by setting the forceServerObjectId flag.

    docs

    Documents to insert.

    callback

    The command result callback

    Example:
    1. insertMany(docs, options, callback): Promise

  64. def insertMany[T <: Any](docs: Array[T], options: |[WriteOptions, RawOptions], callback: MongoCallback[InsertWriteOpResult]): Unit

    Permalink

    Inserts an array of documents into MongoDB.

    Inserts an array of documents into MongoDB. If documents passed in do not contain the _id field, one will be added to each of the documents missing it by the driver, mutating the document. This behavior can be overridden by setting the forceServerObjectId flag.

    docs

    Documents to insert.

    options

    Optional settings.

    callback

    The command result callback

    Example:
    1. insertMany(docs, options, callback): Promise

  65. def insertOne(doc: Any, options: |[WriteOptions, RawOptions], callback: MongoCallback[InsertWriteOpResult]): Unit

    Permalink

    Inserts a single document into MongoDB.

    Inserts a single document into MongoDB. If documents passed in do not contain the _id field, one will be added to each of the documents missing it by the driver, mutating the document. This behavior can be overridden by setting the forceServerObjectId flag.

    doc

    Document to insert.

    options

    Optional settings.

    callback

    The command result callback

  66. def isCapped(callback: MongoCallback[Boolean]): Unit

    Permalink

    Returns if the collection is a capped collection

    Returns if the collection is a capped collection

    callback

    The command result callback

    Example:
    1. isCapped(callback): Promise

  67. def isCapped(): Promise[Boolean]

    Permalink

    Returns if the collection is a capped collection

    Returns if the collection is a capped collection

    Example:
    1. isCapped(callback): Promise

  68. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  69. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  70. def listIndexes(options: RawOptions): Unit

    Permalink

    Get the list of all indexes information for the collection.

    Get the list of all indexes information for the collection.

    options

    Optional settings.

  71. def mapReduce(map: String, reduce: String, options: RawOptions, callback: Function): Unit

    Permalink

    Run Map Reduce across a collection.

    Run Map Reduce across a collection. Be aware that the inline option for out will return an array of results not a collection.

    map

    The mapping function.

    reduce

    The reduce function.

    options

    Optional settings.

    callback

    The command result callback.

    returns

    js.Promise if no callback passed

  72. def mapReduce(map: String, reduce: Function, options: RawOptions, callback: Function): Unit

    Permalink

    Run Map Reduce across a collection.

    Run Map Reduce across a collection. Be aware that the inline option for out will return an array of results not a collection.

    map

    The mapping function.

    reduce

    The reduce function.

    options

    Optional settings.

    callback

    The command result callback.

    returns

    js.Promise if no callback passed

  73. def mapReduce(map: Function, reduce: String, options: RawOptions, callback: Function): Unit

    Permalink

    Run Map Reduce across a collection.

    Run Map Reduce across a collection. Be aware that the inline option for out will return an array of results not a collection.

    map

    The mapping function.

    reduce

    The reduce function.

    options

    Optional settings.

    callback

    The command result callback.

    returns

    js.Promise if no callback passed

  74. def mapReduce(map: Function, reduce: Function, options: RawOptions, callback: Function): Unit

    Permalink

    Run Map Reduce across a collection.

    Run Map Reduce across a collection. Be aware that the inline option for out will return an array of results not a collection.

    map

    The mapping function.

    reduce

    The reduce function.

    options

    Optional settings.

    callback

    The command result callback.

    returns

    js.Promise if no callback passed

  75. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  76. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  78. def options[T <: Any](): Promise[T]

    Permalink

    Returns the options of the collection.

    Returns the options of the collection.

    returns

    the options of the collection.

  79. def options(callback: Function): Unit

    Permalink

    Returns the options of the collection.

    Returns the options of the collection.

    callback

    The results callback

    returns

    the options of the collection.

  80. def parallelCollectionScan(options: RawOptions, callback: Function): Unit

    Permalink

    Return N number of parallel cursors for a collection allowing parallel reading of entire collection.

    Return N number of parallel cursors for a collection allowing parallel reading of entire collection. There are no ordering guarantees for returned results.

    options

    Optional settings.

    callback

    The command result callback.

    returns

    N number of parallel cursors for a collection allowing parallel reading of entire collection.

  81. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  82. def reIndex[T <: Any](): Promise[T]

    Permalink

    Reindex all indexes on the collection Warning: reIndex is a blocking operation (indexes are rebuilt in the foreground) and will be slow for large collections.

  83. def reIndex(callback: Function): Unit

    Permalink

    Reindex all indexes on the collection Warning: reIndex is a blocking operation (indexes are rebuilt in the foreground) and will be slow for large collections.

    Reindex all indexes on the collection Warning: reIndex is a blocking operation (indexes are rebuilt in the foreground) and will be slow for large collections.

    callback

    The command result callback.

  84. def rename[T <: Any](newName: String, options: |[RenameOptions, RawOptions]): Promise[T]

    Permalink

    Rename the collection.

    Rename the collection.

    newName

    New name of of the collection.

    options

    Optional settings.k

    returns

    js.Promise if no callback passed

  85. def rename(newName: String, options: RawOptions, callback: Function): Unit

    Permalink

    Rename the collection.

    Rename the collection.

    newName

    New name of of the collection.

    options

    Optional settings.

    callback

    The results callback

    returns

    js.Promise if no callback passed

  86. def replaceOne[T <: Any](filter: Any, doc: Any, options: RawOptions = js.native): Promise[T]

    Permalink

    Replace a document on MongoDB

    Replace a document on MongoDB

    filter

    The Filter used to select the document to update

    doc

    The Document that replaces the matching document

    options

    Optional settings.

  87. def replaceOne(filter: Any, doc: Any, callback: Function): Unit

    Permalink

    Replace a document on MongoDB

    Replace a document on MongoDB

    filter

    The Filter used to select the document to update

    doc

    The Document that replaces the matching document

    callback

    The results callback

  88. def replaceOne(filter: Any, doc: Any, options: RawOptions, callback: Function): Unit

    Permalink

    Replace a document on MongoDB

    Replace a document on MongoDB

    filter

    The Filter used to select the document to update

    doc

    The Document that replaces the matching document

    options

    Optional settings.

    callback

    The results callback

  89. def stats[T <: Any](options: RawOptions = js.native): Promise[T]

    Permalink

    Get all the collection statistics.

    Get all the collection statistics.

    options

    Optional settings.

  90. def stats(callback: Function): Unit

    Permalink

    Get all the collection statistics.

    Get all the collection statistics.

    callback

    The command result callback

  91. def stats(options: RawOptions, callback: Function): Unit

    Permalink

    Get all the collection statistics.

    Get all the collection statistics.

    options

    Optional settings.

    callback

    The command result callback

  92. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  93. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  94. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  95. def updateMany(filter: Any, update: Any, options: |[UpdateOptions, RawOptions] = js.native): Promise[UpdateWriteOpResultObject]

    Permalink

    Update multiple documents on MongoDB

    Update multiple documents on MongoDB

    filter

    The Filter used to select the document to update

    update

    The update operations to be applied to the document

    options

    Optional settings.

  96. def updateMany(filter: Any, update: |[UpdateOptions, RawOptions], callback: Function2[MongoError, UpdateWriteOpResultObject, Any]): Unit

    Permalink

    Update multiple documents on MongoDB

    Update multiple documents on MongoDB

    filter

    The Filter used to select the document to update

    update

    The update operations to be applied to the document

    callback

    The command result callback

  97. def updateMany(filter: Any, update: Any, options: |[UpdateOptions, RawOptions], callback: Function2[MongoError, UpdateWriteOpResultObject, Any]): Unit

    Permalink

    Update multiple documents on MongoDB

    Update multiple documents on MongoDB

    filter

    The Filter used to select the document to update

    update

    The update operations to be applied to the document

    options

    Optional settings.

    callback

    The command result callback

  98. def updateOne(filter: Any, update: Any, options: |[UpdateOptions, RawOptions] = js.native): Promise[UpdateWriteOpResultObject]

    Permalink

    Update a single document on MongoDB

    Update a single document on MongoDB

    filter

    The Filter used to select the document to update

    update

    The update operations to be applied to the document

    options

    Optional settings.

    returns

    js.Promise if no callback passed

  99. def updateOne(filter: Any, update: Any, callback: Function2[MongoError, UpdateWriteOpResultObject, Any]): Unit

    Permalink

    Update a single document on MongoDB

    Update a single document on MongoDB

    filter

    The Filter used to select the document to update

    update

    The update operations to be applied to the document

    callback

    The command result callback

    returns

    js.Promise if no callback passed

  100. def updateOne(filter: Any, update: Any, options: |[UpdateOptions, RawOptions], callback: Function2[MongoError, UpdateWriteOpResultObject, Any]): Unit

    Permalink

    Update a single document on MongoDB

    Update a single document on MongoDB

    filter

    The Filter used to select the document to update

    update

    The update operations to be applied to the document

    options

    Optional settings.

    callback

    The command result callback

    returns

    js.Promise if no callback passed

  101. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  102. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def dropAllIndexes(callback: Function): Unit

    Permalink

    Drops all indexes from this collection.

    Drops all indexes from this collection.

    callback

    The command result callback

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use dropIndexes

    Example:
    1. dropAllIndexes(callback)

  2. def findAndModify[T <: Any](query: Any, sort: Array[Any], doc: Any, options: RawOptions = null): Promise[T]

    Permalink

    Find and update a document.

    Find and update a document.

    query

    Query object to locate the object to modify.

    sort

    If multiple docs match, choose the first one in the specified sort order as the object to manipulate.

    options

    Optional settings.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use findOneAndUpdate, findOneAndReplace or findOneAndDelete instead

    Example:
    1. findAndModify(query, sort, doc, options, callback)

  3. def findAndModify(query: Any, sort: Array[Any], doc: Any, callback: Function): Unit

    Permalink

    Find and update a document.

    Find and update a document.

    query

    Query object to locate the object to modify.

    sort

    If multiple docs match, choose the first one in the specified sort order as the object to manipulate.

    callback

    The command result callback

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use findOneAndUpdate, findOneAndReplace or findOneAndDelete instead

    Example:
    1. findAndModify(query, sort, doc, options, callback)

  4. def findAndModify(query: Any, sort: Array[Any], doc: Any, options: RawOptions, callback: Function): Unit

    Permalink

    Find and update a document.

    Find and update a document.

    query

    Query object to locate the object to modify.

    sort

    If multiple docs match, choose the first one in the specified sort order as the object to manipulate.

    options

    Optional settings.

    callback

    The command result callback

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use findOneAndUpdate, findOneAndReplace or findOneAndDelete instead

    Example:
    1. findAndModify(query, sort, doc, options, callback)

  5. def findOne[T <: Any](query: Any, options: RawOptions = null): Promise[T]

    Permalink

    Fetches the first document that matches the query

    Fetches the first document that matches the query

    query

    Query for find Operation

    options

    Optional settings.

    returns

    js.Promise if no callback passed

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use find().limit(1).next(function(err, doc){})

    Example:
    1. findOne(query[, options], callback)

  6. def findOne(query: Any, callback: Function): Unit

    Permalink

    Fetches the first document that matches the query

    Fetches the first document that matches the query

    query

    Query for find Operation

    callback

    The command result callback

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use find().limit(1).next(function(err, doc){})

    Example:
    1. findOne(query[, options], callback)

  7. def findOne(query: Any, options: RawOptions, callback: Function): Unit

    Permalink

    Fetches the first document that matches the query

    Fetches the first document that matches the query

    query

    Query for find Operation

    options

    Optional settings.

    callback

    The command result callback

    returns

    js.Promise if no callback passed

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use find().limit(1).next(function(err, doc){})

    Example:
    1. findOne(query[, options], callback)

  8. def insert[T <: Any](docs: Array[T], options: |[WriteOptions, RawOptions], callback: MongoCallback[InsertWriteOpResult]): Unit

    Permalink

    Inserts an array of documents into MongoDB.

    Inserts an array of documents into MongoDB. If documents passed in do not contain the _id field, one will be added to each of the documents missing it by the driver, mutating the document. This behavior can be overridden by setting the forceServerObjectId flag.

    docs

    Documents to insert.

    options

    Optional settings.

    callback

    The command result callback

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use insertOne, insertMany or bulkWrite

  9. def remove(selector: Any, options: WriteOptions, callback: Function): Unit

    Permalink

    Remove documents.

    Remove documents.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use deleteOne, deleteMany or bulkWrite

  10. def remove(selector: Any): Unit

    Permalink

    Remove documents.

    Remove documents.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use deleteOne, deleteMany or bulkWrite

  11. def remove(): Unit

    Permalink

    Remove documents.

    Remove documents.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use deleteOne, deleteMany or bulkWrite

  12. def save(doc: Any, options: |[RawOptions, RawOptions] = js.native): Unit

    Permalink

    Save a document.

    Save a document. Simple full document replacement function. Not recommended for efficiency, use atomic operators and update instead for more efficient operations.

    doc

    Document to save

    options

    Optional settings.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use insertOne, insertMany, updateOne or updateMany

  13. def save(doc: Any, callback: Function): Unit

    Permalink

    Save a document.

    Save a document. Simple full document replacement function. Not recommended for efficiency, use atomic operators and update instead for more efficient operations.

    doc

    Document to save

    callback

    The command result callback

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use insertOne, insertMany, updateOne or updateMany

  14. def save(doc: Any, options: RawOptions, callback: Function): Unit

    Permalink

    Save a document.

    Save a document. Simple full document replacement function. Not recommended for efficiency, use atomic operators and update instead for more efficient operations.

    doc

    Document to save

    options

    Optional settings.

    callback

    The command result callback

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use insertOne, insertMany, updateOne or updateMany

  15. def update(selector: Any, document: Any, options: |[WriteOptions, RawOptions] = js.native): Promise[UpdateWriteOpResultObject]

    Permalink

    Updates documents.

    Updates documents.

    selector

    The selector for the update operation.

    document

    The update document.

    options

    Optional settings.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use updateOne, updateMany or bulkWrite

  16. def update(selector: Any, document: Any): Promise[UpdateWriteOpResultObject]

    Permalink

    Updates documents.

    Updates documents.

    selector

    The selector for the update operation.

    document

    The update document.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use updateOne, updateMany or bulkWrite

  17. def update(selector: Any, document: Any, callback: Function2[MongoError, UpdateWriteOpResultObject, Any]): Unit

    Permalink

    Updates documents.

    Updates documents.

    selector

    The selector for the update operation.

    document

    The update document.

    callback

    The command result callback

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use updateOne, updateMany or bulkWrite

  18. def update(selector: Any, document: Any, options: |[WriteOptions, RawOptions], callback: Function2[MongoError, UpdateWriteOpResultObject, Any]): Unit

    Permalink

    Updates documents.

    Updates documents.

    selector

    The selector for the update operation.

    document

    The update document.

    options

    Optional settings.

    callback

    The command result callback

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0) Use updateOne, updateMany or bulkWrite

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped