Javascript MongoDB查询从数组中检索所有内容?

Javascript MongoDB查询从数组中检索所有内容?,javascript,arrays,json,mongodb,helper,Javascript,Arrays,Json,Mongodb,Helper,我有更多的数组,但我只想检索“PIZZAS”的内容 谁能告诉我哪个是正确的查询 您可以通过投影来实现这一点。在mongo shell中,它如下所示: db.collection.find({}, { PIZZAS: 1, _id: 0})

我有更多的数组,但我只想检索“PIZZAS”的内容

谁能告诉我哪个是正确的查询


您可以通过投影来实现这一点。在mongo shell中,它如下所示:

db.collection.find({}, { PIZZAS: 1, _id: 0})