【发布时间】:2016-09-07 22:11:17
【问题描述】:
使用猫鼬操作过滤用户(管理员)。
他需要查看所有保存的文件……除了草稿文件……
但是他应该能够再次看到自己保存的草稿文件...
代码:
filter = {
'_id':
$nin://not in (dont show)
[{
$and:
[
// {_id : _id},//in this id and
{createBy: {$ne: userId}},//other dan admin and
{status: {$regex: /draft/, $options: 'm'}} //save as draft
]
}]
}
我尝试以这种方式过滤,但以这个错误结束..
exceptionMongoError: Can't canonicalize query: BadValue unknown top level operator: $nin
提前谢谢...
【问题讨论】:
标签: javascript node.js mongodb mongoose