数组条目的注释专家

时间:2019-01-16 05:33:49

标签: mongodb nosql

我们收集了以下文件:

    { "_id" : 1, "name" : "Ian Gillan", "instrument" : "Vocals" }
    { "_id" : 2, "name" : "Ian Paice", "instrument" : "Drums", "born" : 1948 }
    { "_id" : 3, "name" : "Roger Glover", "instrument" : "Bass", "born" : 1945 }
    { "_id" : 4, "name" : "Steve Morse", "instrument" : "Guitar", "born" : 1954 }
    { "_id" : 5, "name" : "Don Airey", "instrument" : "Keyboards", "born" : 1948 }
......
......

给定名称集合作为输入['Roger Glover','Steve Morse','Roger Federer'],我们需要确定是否在文档列表中找到了输入中的所有条目。
为了提高效率,应该在发现第一个不匹配项后立即退出操作。
作为mongoDB的新手,是否需要帮助以最佳方式解决此问题?
另外,如果在“名称”列上定义了索引-仅扫描索引是否可以执行上述操作?

0 个答案:

没有答案