gpt4 book ai didi

mongodb - $and inside $elemMatch 在 Meteor 中不工作

转载 作者:可可西里 更新时间:2023-11-01 09:52:15 25 4
gpt4 key购买 nike

我有以下查询

{
lessen: {
$not: {
$elemMatch: {
$and: [
{start: {$lt: new Date()}},
{eind: {$gt: new Date()}}
]
}
}
}
}

在我更新到 Meteor 0.8 之前,它工作得很好。现在它抛出 Error: Unrecognized operator: $and。有谁知道如何解决这个问题?

最佳答案

在这种情况下您不需要使用 $and 运算符,您可以像这样简单地编写查询:

{
lessen: {
$not: {
$elemMatch: {
start: {$lt: new Date()},
eind: {$gt: new Date()}
}
}
}
}

关于mongodb - $and inside $elemMatch 在 Meteor 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22787193/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com