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

Comment on: "manual/reference/operator/query/elemMatch.txt"

    XMLWordPrintableJSON

Details

    Description

      Element Match: documentation issue (show wrong result)

      Given the following documents in the scores collection:

      { _id: 1, results: [ 82, 85, 88 ] } { _id: 2, results: [ 75, 88, 89 ] }

      db.scores.find(
      { results: { $elemMatch:

      { $gte: 80, $lt: 85 }

      } }
      )

      The query returns the following document since the element 82 is both greater than or equal to 80 and is less than 85

      Results:(Wrong results here)

      { "_id" : 1, "results" : [ 82, 85, 88 ] }

      Attachments

        Activity

          People

            Unassigned Unassigned
            weiztech@gmail.com je we
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              7 years, 39 weeks, 1 day ago