Query generated by Filters.not is not always valid

XMLWordPrintableJSON

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

      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 Lawley
              Reporter:
              Boris Petrov
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: