Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

624
Views
Mongo "Nombre de etapa de canalización no reconocido: '$filter'"

Estoy tratando de ejecutar la siguiente consulta en el último servidor mongo 3.4.1 y el shell 3.4.1.

 db.dealer.aggregate( [ {$match:{salesAreaId:{$in:[ObjectId("5858d03ec5109a098c854802")]}}}, {$lookup:{ from:"outstanding", localField:"_id", foreignField:"dealer_id", as:"outstandings" }}, {$filter:{ input:"$outstandings", as:"outstandings", cond:{ $is:{"$$outstandings.finalized":false} } }} ] )

pero dice

 Error: command failed: { "ok" : 0, "errmsg" : "Unrecognized pipeline stage name: '$filter'", "code" : 40324, "codeName" : "Location40324" } : aggregate failed : _getErrorWithCode@src/mongo/shell/utils.js:23:13 doassert@src/mongo/shell/assert.js:13:14 assert.commandWorked@src/mongo/shell/assert.js:266:5 DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1215:5 @(shell):1:1

De acuerdo con la documentación, $filter es compatible desde v3.2 en adelante. Alguna ayuda.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Reemplace el siguiente código

 db.dealer.aggregate( [ {$match:{salesAreaId:{$in:[ObjectId("5858d03ec5109a098c854802")]}}}, {$lookup:{ from:"outstanding", localField:"_id", foreignField:"dealer_id", as:"outstandings" }}, {$project:{ outstandings:{$filter:{ input:"$outstandings", as:"outstandings", cond:{ $is:{"$$outstandings.finalized":false} } } } } } ])

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!