MongoDBコレクション: MongoDBコレクション内のすべてのドキュメントの単一フィールドを選択する方法
2024 ワード
db.inventory.find( { type: 'food' }, { item: 1, qty: 1 } )
Mongoの人々からの上記の例では、返されたドキュメントはアイテム、QTYとCHERIDのフィールドだけを含みます.db.inventory.find( { type: 'food' }, { item: 1, qty: 0 } )
Mongoの人々からの上記の例では、返されたドキュメントは項目のフィールドだけを含んでいます.参考文献
Reference
この問題について(MongoDBコレクション: MongoDBコレクション内のすべてのドキュメントの単一フィールドを選択する方法), 我々は、より多くの情報をここで見つけました https://dev.to/peterlau/mongodb-how-to-select-a-single-field-for-all-documents-in-a-mongodb-collection-o39テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol