Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-826

Array.0 exists true doesn't work correct

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Critical - P2 Critical - P2
    • None
    • 2.11.1
    • API
    • None
    • Mac OS X

    Description

      In one collection I have an embedded array of ObjectIds. The name of the array is "user_ids". I wrote a query to fetch all elements from the collection where the array has at least 1 element. The native MongoDB query looks like this:

      db.mycollection.find( {"user_ids.0" :

      { "$exists" : true }

      } )

      and it works fine. It returns 2 elements. In Java I did it like this:

      query.put("user_ids.0", new BasicDBObject("$exists", Boolean.TRUE) );

      Unfortunately it returns only 1 element. 1 is missing.
      It looks like a bug.

      Attachments

        Activity

          People

            Unassigned Unassigned
            reiz Robert Reiz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: