Pregunta

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?

¿Fue útil?

Solución

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()}
            }
        }
    }
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top