MongoDB检查数组是否在数组中

时间:2015-10-14 14:45:19

标签: mongodb meteor

我想计算我的收藏中的条目数,但看起来我的代码不起作用。

var count = LeavesCollection.find({ $and:[
        {user_id: {$ne: Meteor.userId()}},
        {associate_tower: {$in: Meteor.user().profile.tower}},
        {leaves_approval_status: {$not: {$ne: 'Pre-Approved'}}}
    ]}).count();

如果我删除第二个查询(associate_tower),则计数正常。 Associate塔是一个数组(例如[" Support"]),Meteor.user().profile.tower也是一个数组(例如["支持",QAS,PPD])

我怎样才能达到合适的数量?

0 个答案:

没有答案
相关问题