Execute an aggregation framework pipeline against the collection, needs MongoDB >= 2.2
Execute an aggregation framework pipeline against the collection, needs MongoDB >= 2.2
Array containing all the aggregation framework commands for the execution.
aggregate(pipeline, options, callback)
Execute an aggregation framework pipeline against the collection, needs MongoDB >= 2.2
Execute an aggregation framework pipeline against the collection, needs MongoDB >= 2.2
Array containing all the aggregation framework commands for the execution.
The command result callback
aggregate(pipeline, options, callback)
Execute an aggregation framework pipeline against the collection, needs MongoDB >= 2.2
Execute an aggregation framework pipeline against the collection, needs MongoDB >= 2.2
Array containing all the aggregation framework commands for the execution.
Optional settings.
The command result callback
aggregate(pipeline, options, callback)
Perform a bulkWrite operation without a fluent API
Perform a bulkWrite operation without a fluent API
Bulk operations to perform.
Optional settings.
bulkWrite(operations, options, callback)
Perform a bulkWrite operation without a fluent API
Perform a bulkWrite operation without a fluent API
Bulk operations to perform.
The command result callback
bulkWrite(operations, options, callback)
Perform a bulkWrite operation without a fluent API
Perform a bulkWrite operation without a fluent API
Bulk operations to perform.
Optional settings.
The command result callback
bulkWrite(operations, options, callback)
Count number of matching documents in the db to a query.
Count number of matching documents in the db to a query.
The query for the count.
Optional settings.
count(query, options, callback)
Count number of matching documents in the db to a query.
Count number of matching documents in the db to a query.
The query for the count.
Optional settings.
The command result callback
count(query, options, callback)
Creates an index on the db and collection collection.
Creates an index on the db and collection collection.
Defines the index.
Optional settings.
createIndex(fieldOrSpec, options[, callback])
Creates an index on the db and collection collection.
Creates an index on the db and collection collection.
Defines the index.
The command result callback
createIndex(fieldOrSpec, options[, callback])
Creates an index on the db and collection collection.
Creates an index on the db and collection collection.
Defines the index.
Optional settings.
The command result callback
createIndex(fieldOrSpec, options[, callback])
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/ }}}
An array of index specifications to be created
The command result callback
createIndexes(indexSpecs, callback)
Delete multiple documents on MongoDB
Delete multiple documents on MongoDB
The Filter used to select the documents to remove
Optional settings.
deleteMany(filter, options, callback)
Delete multiple documents on MongoDB
Delete multiple documents on MongoDB
The Filter used to select the documents to remove
The command result callback
deleteMany(filter, options, callback)
Delete multiple documents on MongoDB
Delete multiple documents on MongoDB
The Filter used to select the documents to remove
Optional settings.
The command result callback
deleteMany(filter, options, callback)
Delete a document on MongoDB
Delete a document on MongoDB
The Filter used to select the document to remove
Optional settings.
Delete a document on MongoDB
Delete a document on MongoDB
The Filter used to select the document to remove
The command result callback
Delete a document on MongoDB
Delete a document on MongoDB
The Filter used to select the document to remove
Optional settings.
The command result callback
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.
Field of the document to find distinct values for.
The query for filtering the set of documents to which we apply the distinct filter.
Optional settings.
The command result callback
distinct(key, query, options, callback)
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.
drop(callback)
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.
The command result callback
drop(callback)
Drops an index from this collection.
Drops an index from this collection.
Name of the index to drop.
Optional settings.
The command result callback
dropIndex(indexName, options, callback)
Drops all indexes from this collection.
Drops all indexes from this collection.
The command result callback
dropIndexes(callback)
Ensures that an index exists, if it does not it creates it
Ensures that an index exists, if it does not it creates it
Defines the index.
Optional settings.
????
ensureIndex(fieldOrSpec, options)
Ensures that an index exists, if it does not it creates it
Ensures that an index exists, if it does not it creates it
Defines the index.
Optional settings.
The command result callback
ensureIndex(fieldOrSpec, options, callback)
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
find([selector[, projection]])
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
find([selector[, projection]])
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
find([selector[, projection]])
Find and remove a document.
Find and remove a document.
Query object to locate the object to modify.
If multiple docs match, choose the first one in the specified sort order as the object to manipulate.
Optional settings.
findAndRemove(query, sort, options, callback)
Find and remove a document.
Find and remove a document.
Query object to locate the object to modify.
If multiple docs match, choose the first one in the specified sort order as the object to manipulate.
Optional settings.
The command result callback
findAndRemove(query, sort, options, callback)
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.
Document selection filter.
The command result callback
findOneAndDelete(filter[, options], callback)
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.
Document selection filter.
Optional settings.
The command result callback
findOneAndDelete(filter[, options], callback)
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.
Document selection filter.
Document replacing the matching document.
Optional settings.
The command result callback
findOneAndReplace(filter, replacement, options, callback)
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.
Document selection filter.
Update operations to be performed on the document
Optional settings.
findOneAndUpdate(filter, update, options, callback)
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.
Document selection filter.
Update operations to be performed on the document
The command result callback
findOneAndUpdate(filter, update, options, callback)
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.
Document selection filter.
Update operations to be performed on the document
Optional settings.
The command result callback
findOneAndUpdate(filter, update, options, callback)
Execute a geo search using a geo haystack index on a collection.
Execute a geo search using a geo haystack index on a collection.
Point to search on the x axis, ensure the indexes are ordered in the same order.
Point to search on the y axis, ensure the indexes are ordered in the same order.
Optional settings.
The command result callback
Execute the geoNear command to search for items in the collection
Execute the geoNear command to search for items in the collection
Point to search on the x axis, ensure the indexes are ordered in the same order.
Point to search on the y axis, ensure the indexes are ordered in the same order.
Optional settings.
The command result callback
An object, array or function expressing the keys to group by.
An optional condition that must be true for a row to be considered.
Initial value of the aggregation counter object.
The reduce function aggregates (reduces) the objects iterated
An optional function to be run on each item in the result set just before the item is returned.
Specify if you wish to run using the internal group command or using eval, default is true.
Optional settings
The command result callback
group(keys, condition, initial, reduce, finalize, command, options, callback)
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
One or more index names to check.
Promise if no callback passed
indexExists(indexes, callback)
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
One or more index names to check.
The command result callback
Promise if no callback passed
indexExists(indexes, callback)
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
One or more index names to check.
Promise if no callback passed
indexExists(indexes, callback)
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
One or more index names to check.
The command result callback
Promise if no callback passed
indexExists(indexes, callback)
Retrieves this collections index info.
Retrieves this collections index info.
Optional settings.
The command result callback
indexInformation(options, callback)
Retrieve all the indexes on the collection.
Retrieve all the indexes on the collection.
The command result callback
indexes(callback)
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.
Optional settings.
The command result callback
initializeOrderedBulkOp(options, callback)
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.
Optional settings.
initializeUnorderedBulkOp(options)
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.
Document to insert.
The command result callback
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.
Document to insert.
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.
the given document
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.
Documents to insert.
Optional settings.
insertMany(docs, options, callback): Promise
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.
Documents to insert.
The command result callback
insertMany(docs, options, callback): Promise
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.
Documents to insert.
Optional settings.
The command result callback
insertMany(docs, options, callback): Promise
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.
Document to insert.
Optional settings.
The command result callback
Returns if the collection is a capped collection
Returns if the collection is a capped collection
The command result callback
isCapped(callback): Promise
Returns if the collection is a capped collection
Returns if the collection is a capped collection
isCapped(callback): Promise
Get the list of all indexes information for the collection.
Get the list of all indexes information for the collection.
Optional settings.
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.
The mapping function.
The reduce function.
Optional settings.
The command result callback.
js.Promise if no callback passed
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.
The mapping function.
The reduce function.
Optional settings.
The command result callback.
js.Promise if no callback passed
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.
The mapping function.
The reduce function.
Optional settings.
The command result callback.
js.Promise if no callback passed
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.
The mapping function.
The reduce function.
Optional settings.
The command result callback.
js.Promise if no callback passed
Returns the options of the collection.
Returns the options of the collection.
the options of the collection.
Returns the options of the collection.
Returns the options of the collection.
The results callback
the options of the collection.
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.
Optional settings.
The command result callback.
N number of parallel cursors for a collection allowing parallel reading of entire collection.
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.
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.
The command result callback.
Rename the collection.
Rename the collection.
New name of of the collection.
Optional settings.k
js.Promise if no callback passed
Rename the collection.
Rename the collection.
New name of of the collection.
Optional settings.
The results callback
js.Promise if no callback passed
Replace a document on MongoDB
Replace a document on MongoDB
The Filter used to select the document to update
The Document that replaces the matching document
Optional settings.
Replace a document on MongoDB
Replace a document on MongoDB
The Filter used to select the document to update
The Document that replaces the matching document
The results callback
Replace a document on MongoDB
Replace a document on MongoDB
The Filter used to select the document to update
The Document that replaces the matching document
Optional settings.
The results callback
Get all the collection statistics.
Get all the collection statistics.
Optional settings.
Get all the collection statistics.
Get all the collection statistics.
The command result callback
Get all the collection statistics.
Get all the collection statistics.
Optional settings.
The command result callback
Update multiple documents on MongoDB
Update multiple documents on MongoDB
The Filter used to select the document to update
The update operations to be applied to the document
Optional settings.
Update multiple documents on MongoDB
Update multiple documents on MongoDB
The Filter used to select the document to update
The update operations to be applied to the document
The command result callback
Update multiple documents on MongoDB
Update multiple documents on MongoDB
The Filter used to select the document to update
The update operations to be applied to the document
Optional settings.
The command result callback
Update a single document on MongoDB
Update a single document on MongoDB
The Filter used to select the document to update
The update operations to be applied to the document
Optional settings.
js.Promise if no callback passed
Update a single document on MongoDB
Update a single document on MongoDB
The Filter used to select the document to update
The update operations to be applied to the document
The command result callback
js.Promise if no callback passed
Update a single document on MongoDB
Update a single document on MongoDB
The Filter used to select the document to update
The update operations to be applied to the document
Optional settings.
The command result callback
js.Promise if no callback passed
Drops all indexes from this collection.
Drops all indexes from this collection.
The command result callback
(Since version 2.0) Use dropIndexes
dropAllIndexes(callback)
Find and update a document.
Find and update a document.
Query object to locate the object to modify.
If multiple docs match, choose the first one in the specified sort order as the object to manipulate.
Optional settings.
(Since version 2.0) Use findOneAndUpdate, findOneAndReplace or findOneAndDelete instead
findAndModify(query, sort, doc, options, callback)
Find and update a document.
Find and update a document.
Query object to locate the object to modify.
If multiple docs match, choose the first one in the specified sort order as the object to manipulate.
The command result callback
(Since version 2.0) Use findOneAndUpdate, findOneAndReplace or findOneAndDelete instead
findAndModify(query, sort, doc, options, callback)
Find and update a document.
Find and update a document.
Query object to locate the object to modify.
If multiple docs match, choose the first one in the specified sort order as the object to manipulate.
Optional settings.
The command result callback
(Since version 2.0) Use findOneAndUpdate, findOneAndReplace or findOneAndDelete instead
findAndModify(query, sort, doc, options, callback)
Fetches the first document that matches the query
Fetches the first document that matches the query
Query for find Operation
Optional settings.
js.Promise if no callback passed
(Since version 2.0) Use find().limit(1).next(function(err, doc){})
findOne(query[, options], callback)
Fetches the first document that matches the query
Fetches the first document that matches the query
Query for find Operation
The command result callback
(Since version 2.0) Use find().limit(1).next(function(err, doc){})
findOne(query[, options], callback)
Fetches the first document that matches the query
Fetches the first document that matches the query
Query for find Operation
Optional settings.
The command result callback
js.Promise if no callback passed
(Since version 2.0) Use find().limit(1).next(function(err, doc){})
findOne(query[, options], callback)
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.
Documents to insert.
Optional settings.
The command result callback
(Since version 2.0) Use insertOne, insertMany or bulkWrite
Remove documents.
Remove documents.
(Since version 2.0) Use deleteOne, deleteMany or bulkWrite
Remove documents.
Remove documents.
(Since version 2.0) Use deleteOne, deleteMany or bulkWrite
Remove documents.
Remove documents.
(Since version 2.0) Use deleteOne, deleteMany or bulkWrite
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.
Document to save
Optional settings.
(Since version 2.0) Use insertOne, insertMany, updateOne or updateMany
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.
Document to save
The command result callback
(Since version 2.0) Use insertOne, insertMany, updateOne or updateMany
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.
Document to save
Optional settings.
The command result callback
(Since version 2.0) Use insertOne, insertMany, updateOne or updateMany
Updates documents.
Updates documents.
The selector for the update operation.
The update document.
Optional settings.
(Since version 2.0) Use updateOne, updateMany or bulkWrite
Updates documents.
Updates documents.
The selector for the update operation.
The update document.
(Since version 2.0) Use updateOne, updateMany or bulkWrite
Updates documents.
Updates documents.
The selector for the update operation.
The update document.
The command result callback
(Since version 2.0) Use updateOne, updateMany or bulkWrite
Updates documents.
Updates documents.
The selector for the update operation.
The update document.
Optional settings.
The command result callback
(Since version 2.0) Use updateOne, updateMany or bulkWrite
Mongo Collection
http://mongodb.github.io/node-mongodb-native/2.1/api/index.html