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

Query generated by Filters.not is not always valid

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.9.1, 3.10.0
    • Affects Version/s: 3.7.1
    • Component/s: Builders
    • Labels:

      Filters.and(
        Filters.not(Filters.eq("foo", new DBRef("1", "1"))),
        Filters.not(Filters.eq("foo.bar", new DBRef("1", "1"))))
      

      This code generates the query:

      { "foo" : { "$not" : { "$ref" : "1", "$id" : "1" } }, "foo.bar" : { "$not" : { "$ref" : "1", "$id" : "1" } } }
      

      Which after that complains with:

      com.mongodb.MongoQueryException: Query failed with error code 2 and error message 'unknown operator: $ref' on server localhost:27017

      When passed to the DB. Am I missing something or is this a bug?

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            alien Boris Petrov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: