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?