私はフィールドとして場所と名前を持つコレクションを持っています。なぜmongoはすべてのフィールドを返さないのですか?
私はrobomongoでこれを実行すると私はこれを実行すると、それは、すべての12個のフィールドを返す
db.getCollection('_event').find({"location.country":"United States"})
しかし、以下のようなマングースと名前を
eventSchema.index({name: 'text'});
をインデックスを作成しましたrobomongo、idとlocationの2つのフィールドのみを返します。
db.getCollection('_event').find({$text: {$search: "2017 Honda"}},{"location.country":"United States"})