node.js - 为什么我不能在 Mongo 管道匹配中使用 $nin、$exists 等?
问题描述
对于这个答案,我一直在寻找高低,但没有任何效果。我有一个管道查询,其匹配项如下:
$match: {
$expr: {
$and: [
....
]
}
}
在 $and 中,我有各种使用 $eq、$in、$ne、$gt、$lt 等的条件。
但是尽我所能,我无法让它识别 $nin 或 $exists。我正在尝试添加一个术语来搜索不存在的键,例如:
{ $exists: [ '$key', 0 ] }
我不断得到
MongoError:无法识别的表达式'$exists'
和
MongoError:无法识别的表达式'$nin'
有人可以帮忙吗??
解决方案
推荐阅读
- css - 在本地使用 Angular 9 材质样式
- javascript - 如何使用谷歌图表绘制 CSV 数据文件?
- c# - SQLite 查询未在 WPF 项目中正确执行
- javascript - 使用上下文和reducer在React中删除数组中的项目
- azure-devops-server-2019 - Azure Devops Server 无法连接到代理后面的服务挂钩
- arrays - 从二进制数组输入确定布尔方程
- sql - 包含产品销售额和数量的表 - 添加计算产品的列
- java - 从 HashMap 获取值并填充 Java 对象
- android - 我无法通过其 ID 或标签找到片段
- unity3d - Hololens 2 上的 LocatableCamera (PhotoCapture)