The methods listed on this table of contents page are 目录页上列出的方法是mongosh methods. mongosh方法。 This is not the documentation for 这不是Node.js or other programming language specific driver methods.Node.js或其他编程语言特定驱动程序方法的文档。
In most cases, 在大多数情况下,mongosh methods work the same way as the legacy mongo shell methods. mongosh方法的工作方式与传统mongoShell方法相同。However, some legacy methods are unavailable in 但是,一些传统方法在mongosh.mongosh中不可用。
For the legacy 有关传统mongo shell documentation, refer to the documentation for the corresponding MongoDB Server release:mongoShell文档,请参阅相应MongoDB服务器版本的文档:
For MongoDB API drivers, refer to the language specific MongoDB driver documentation.有关MongoDB API驱动程序,请参阅特定于语言的MongoDB驱动程序文档。
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.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.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.estimatedDocumentCount() | count to return an approximate count of the documents in a collection or a view.count以返回集合或视图中文档的近似计数。 |
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.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.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.updateOne() | |
db.collection.updateMany() | |
db.collection.watch() | |
db.collection.validate() |