58. Consider the following query: db.movies.find( {"countries.0": "France", "genres.0": "Documentary"}, {"countries":1, "genres":1, "title":1, "year":1, "_id":0} ) Choose the best answer:
题目选项
- A.{ "genres" : [ "Documentary", "History", "Music" ], "title" : "Woodstock", "year" : 1970, "countries" : [ "USA" ] }
- B.{ "_id" : ObjectId("573a1399f29313caabcedc24"), "genres" : [ "Documentary" ], "title" : "It's All True", "year" : 1993, "countries" : [ "France", "USA" ] }
- C.{ "genres" : [ "Documentary" ], "title" : "Nanook of the North", "year" : 1922, "countries" : [ "USA", "France" ] }
- D.{ "genres" : [ "Documentary" ], "title" : "F for Fake", "year" : 1973, "countries" : [ "France", "Iran", "West Germany" ] }
答案置信度:高
正确答案:D
解析语言:中文
countries.0 与 genres.0 只匹配数组的第一个元素,因此文档必须满足 countries[0]="France" 且 genres[0]="Documentary",D 正确(投影里有 _id:0,输出不应出现 _id)。B 仍然输出了 _id,直接排除;A 的 countries[0] 是 USA、C 的 countries[0] 也是 USA,都不满足条件。