Allow Map instances to be passed in query objects since this is permitted in the Java driver. #11

Merged
merged 1 commit into from Dec 17, 2012

Projects

None yet

2 participants

@tobyclemson

The Java Driver supports a query object of the following form:

HashMap<String, Object> operatorMap = new HashMap<String, Object>();
operatorMap.put("$in", asList(1, 2, 3));
BasicDBObject query = new BasicDBObject("a", operatorMap);

with a value that is a Map containing further expressions and operators.

It is important to me that this is supported since this behaviour is leveraged by morphia when creating queries.

This pull request extends ExpressionParser to allow this case and adds a test to demonstrate usage.

@hoffrocket hoffrocket merged commit 124d973 into foursquare:master Dec 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment