Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-12543

$and operator accepts one expression

    XMLWordPrintableJSON

Details

    • Icon: Typo Typo
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • 3.6.6
    • manual
    • None
    • 0.1

    Description

      Description

      From the mongoDB documentation:

      {{}}

      $and performs a logical AND operation on an array of two or more expressions

       

      However, I am able to run a mongo query with just one expression.

      For example in Studio 3T I run:

      db.getCollection("mycollection").find({ 

      "$and": [

      { "memId":"07e3c5560dc125689eb75bfd120ceb91"  }

      ]

      })

       

      Is this a typo in the documentation or an incorrect implementation of mongoDB?

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

      Attachments

        Activity

          People

            ravind.kumar Ravind Kumar (Inactive)
            betty.leung@interpreta.com Betty Leung
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              4 years, 46 weeks ago