Answers for "mongodb aggregate match objectid"

0

how to use id in aggregate

const ObjectId = mongoose.Types.ObjectId;
const User = mongoose.model('User')

User.aggregate([
  {
    $match: { _id: ObjectId('560c24b853b558856ef193a3') }
  }
])
Posted by: Guest on November-02-2020
0

mongodb aggregate match objectid

{
        $match: {
          '$and': [


            { 'user': new ObjectId("62338e36741e67bd32d2130e") },
            { 'pseudo': 'bnr' },

          ]
        }
      }
Posted by: Guest on April-14-2022

Code answers related to "mongodb aggregate match objectid"

Code answers related to "Javascript"

Browse Popular Code Answers by Language