我需要检查MongoDB中的值是否不在数组中。这应该与另外两个与$and
相关的检查一起发生。
这是我的代码:
Meteor.users.findOne({$and:[{"profile.assigned":"somevalue"},
{_id: {$ne: someoneId} },
{"the array": {the value which should not be in the array} }
]});
执行该查询的语法是正确的。我在这里注意到一些问题,但是找不到与我的问题有关的东西。我应该查询一个特定的数组,该数组是用户的属性并包含其他一些id。