查找包含数组值的文档

时间:2016-06-25 23:27:10

标签: mongodb mongoose

假设我有这些文件:

if (!$mysqli_multi_query($link, $sql)) {

如果我这样做:

shirt1 = {colors: ["red"]}
shirt2 = {colors: ["blue"]}
shirt3 = {colors: ["red","blue"]}

我会把衬衫1和衬衫3弄回来吗?

如果我只想要,我的查询是什么:

  • 只有Shirt1
  • 只有Shirt1和Shirt2
  • 只有Shirt3
  • 所有衬衫

我认为这会给我所有的衬衫吗?

Shirt.find({ colors: "red" }, ...);

0 个答案:

没有答案