[英]How to Apply not in condition inside the populate in mongoose with express?
How to apply "not in" query inside populate as below in Mongoose with Express js ? 如何使用Express js在Mongoose中按以下方式在内部填充“ not in”查询?
Users
.find({ user_enabled: true })
.populate({
path: 'books',
match: { 'language': 'en' },
[ Not in en language ]
[不是用英语]
})
.exec()
Users
.find({ user_enabled: true })
.populate({
path: 'books',
match: { 'language': {$not: 'en'} }, })
.exec()
Have you tried $ne
operator? 您是否尝试过
$ne
运算符?
So in your case: 因此,在您的情况下:
Users
.find({ user_enabled: true })
.populate({
path: 'books',
match: { language: { $ne: "en" } },
})
.exec()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.