Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mongoose operand find method

const docs = await Character.find({
  $and: [
    {
      $or: [
        { age: { $gte: 29 } },
        { rank: 'Commander' }
      ]
    },
    {
      $or: [
        { name: { $lte: 'D' } },
        { name: { $gte: 'W' } }
      ]
    }
  ]
});

// ['William Riker']
docs.map(doc => doc.name).sort();
Source by masteringjs.io #
 
PREVIOUS NEXT
Tagged: #mongoose #operand #find #method
ADD COMMENT
Topic
Name
8+9 =