mongo
Shell Methods
The methods listed on this table of contents page refer to the 此目录页上列出的方法指的是mongo
shell methods, and not to the MongoDB Node.js driver (or any other driver) methods. mongo
shell方法,而不是MongoDB Node.js驱动程序(或任何其他驱动程序)方法。For corresponding MongoDB driver API, refer to your specific MongoDB driver documentation instead.有关相应的MongoDB驱动程序API,请参阅特定的MongoDB驱动程序文档。
Note
For details on specific methods, including syntax and examples, click on the specific method to go to its reference page.有关特定方法的详细信息,包括语法和示例,请单击特定方法以转到其参考页。
db.collection.aggregate() |
|
db.collection.bulkWrite() |
|
db.collection.copyTo() |
|
db.collection.count() |
count to return a count of the number of documents in a collection or a view.count 以返回集合或视图中文档数的计数。 |
db.collection.countDocuments() |
$group aggregation stage with a $sum expression to return a count of the number of documents in a collection or a view.$sum 表达式的$group 聚合阶段,以返回集合或视图中文档数的计数。 |
db.collection.estimatedDocumentCount() |
count to return an approximate count of the documents in a collection or a view.count 以返回集合或视图中文档的大致计数。 |
db.collection.createIndex() |
|
db.collection.createIndexes() |
|
db.collection.dataSize() |
size field in the output of the collStats .collStats 输出中的size 字段。 |
db.collection.deleteOne() |
|
db.collection.deleteMany() |
|
db.collection.distinct() |
|
db.collection.drop() |
|
db.collection.dropIndex() |
|
db.collection.dropIndexes() |
|
db.collection.ensureIndex() |
db.collection.createIndex() .db.collection.createIndex() 。 |
db.collection.explain() |
|
db.collection.find() |
|
db.collection.findAndModify() |
|
db.collection.findOne() |
|
db.collection.findOneAndDelete() |
|
db.collection.findOneAndReplace() |
|
db.collection.findOneAndUpdate() |
|
db.collection.getIndexes() |
|
db.collection.getShardDistribution() |
db.collection.getShardDistribution() reports data of chunk distribution.db.collection.getShardDistribution() 报告区块分布的数据。 |
db.collection.getShardVersion() |
|
db.collection.hideIndex() |
|
db.collection.insert() |
|
db.collection.insertOne() |
|
db.collection.insertMany() |
|
db.collection.isCapped() |
|
db.collection.latencyStats() |
|
db.collection.mapReduce() |
|
db.collection.reIndex() |
|
db.collection.remove() |
|
db.collection.renameCollection() |
|
db.collection.replaceOne() |
|
db.collection.save() |
insert() and update() to insert new documents.insert() 和update() 周围提供包装器以插入新文档。 |
db.collection.stats() |
collStats .collStats 的包装器。 |
db.collection.storageSize() |
storageSize field of the collStats output.collStats 输出的storageSize 字段周围提供包装器。 |
db.collection.totalIndexSize() |
totalIndexSize field of the collStats output.collStats 输出的totalIndexSize 字段的包装器。 |
db.collection.totalSize() |
|
db.collection.unhideIndex() |
|
db.collection.update() |
|
db.collection.updateOne() |
|
db.collection.updateMany() |
|
db.collection.watch() |
|
db.collection.validate() |