문제

I have the following query

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

This worked perfectly until I updated to Meteor 0.8. Now it throws Error: Unrecognized operator: $and. Does anyone know how to fix this?

도움이 되었습니까?

해결책

You don't need to use the $and operator in this case you can simply write the query like this:

{
    lessen: {
        $not: {
            $elemMatch: {
                start: {$lt: new Date()},
                eind: {$gt: new Date()}
            }
        }
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top