Collection Methods集合方法
mongosh Methods
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 对于遗留的mongoshell文档,请参阅相应MongoDB Server版本的文档:mongo shell documentation, refer to the documentation for the corresponding MongoDB Server release:
For MongoDB API drivers, refer to the language specific MongoDB driver documentation.有关MongoDB API驱动程序,请参阅特定语言的MongoDB驱动程序文档。
For details on a specific method, including syntax and examples, click on the link to the method's reference page.有关特定方法的详细信息,包括语法和示例,请单击该方法参考页的链接。
db.collection.analyzeShardKey() | |
db.collection.aggregate() | |
db.collection.bulkWrite() | |
db.collection.configureQueryAnalyzer() | |
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() |