[英]In Mongo, how do I only display documents with the highest value for a key that they share?
[英]In Mongo, how do I find all the documents, but display only their titles?
每個文檔中都有一個['title']屬性。 我該如何查找但僅顯示標題?
您可以按以下方式在文檔中檢索字段的子集:
例如,僅檢索具有給定ISBN的書籍的書名字段:
db.Books.find({ISBN : "1234567890" }, { title : 1 } );
您還可以進行字段求反,即返回除指定字段之外的所有字段。 MongoDB.org上對此有很好的參考
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.