1
我想建立一个查询,将看在data.tags结果如下:含以下标签PARAMS返回
“数据”对象:
tags : [ 'a', 'c' ]
tags : [ 'a', 'd' ]
tags : [ 'b', 'c' ]
tags : [ 'b', 'd' ]
,并含有以下标签PARAMS不返回“数据”对象:
tags : [ 'a', 'b' ]
tags : [ 'c', 'd' ]
any others
我开始与查询低于,但似乎并不奏效:
db.data.find({ $and : [ {tags: {$in: ['a', 'b']}}, {tags: { $in: ['c', 'd']} } ] })