【发布时间】:2017-07-07 22:05:24
【问题描述】:
我有一个包含位置和名称作为字段的集合。
我用下面的猫鼬为名字创建了索引,
eventSchema.index({name: 'text'});
当我在 robomongo 上运行它时,它会返回所有 12 个字段,
db.getCollection('_event').find({"location.country":"United States"})
但是当我在 robomongo 上运行它时,它只返回两个字段的值,id 和 location,
db.getCollection('_event').find({$text: {$search: "2017 Honda"}},{"location.country":"United States"})
【问题讨论】: