sql >> Base de Datos >  >> NoSQL >> MongoDB

Los argumentos agregados de Mongodb a $búsqueda deben ser cadenas

Porque está tratando de usar el $lookup características (sintaxis) de MongoDB v3.6 en MongoDB v3.4

El MongoDB v3.4 $lookup sintaxis:

{
   $lookup:
     {
       from: <collection to join>,
       localField: <field from the input documents>,
       foreignField: <field from the documents of the "from" collection>,
       as: <output array field>
     }
}

El MongoDB v3.6 $lookup sintaxis:

{
   $lookup:
     {
       from: <collection to join>,
       let: { <var_1>: <expression>, …, <var_n>: <expression> },
       pipeline: [ <pipeline to execute on the collection to join> ],
       as: <output array field>
     }
}

https://docs.mongodb.com/manual/reference/operator/ agregación/búsqueda/