mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-03 21:07:49 +08:00
Change $or to $nor in serialization of Ops.NOT in MongodbSerializer
This commit is contained in:
parent
fbf2d23c62
commit
126258f2c4
@ -127,11 +127,9 @@ public abstract class MongodbSerializer implements Visitor<Object, Void> {
|
||||
if (subOp == Ops.IN) {
|
||||
return visit(OperationImpl.create(Boolean.class, Ops.NOT_IN, subOperation.getArg(0),
|
||||
subOperation.getArg(1)), context);
|
||||
} else if (subOp == Ops.COL_IS_EMPTY) {
|
||||
DBObject visit = (DBObject)visit(OperationImpl.create(Boolean.class, Ops.COL_IS_EMPTY, subOperation.getArg(0)), context);
|
||||
Object existingOperator = visit.removeField("$or");
|
||||
visit.put("$nor", existingOperator);
|
||||
return visit;
|
||||
} else if (key.equals("$or")) {
|
||||
return asDBObject("$nor", arg.get(key));
|
||||
|
||||
} else if (subOp != Ops.EQ && subOp != Ops.STRING_IS_EMPTY) {
|
||||
return asDBObject(key, asDBObject("$not", arg.get(key)));
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user