If this is my document in mongo:
{ "_id" : ObjectId("4ea630b9e0eee526908d2614"), "address" : { "street" : "710 Montgomery St", "city" : "San Francisco", "state" : "CA" }, "latlong" : [ 37.795799, -122.403229 ], "name" : "Bocadillos", "phone" : "4159822622", "societies" : [ ObjectId("4e59693a9df7a393a15388e7") ] }
How do I create a query that allows me to select a document based on the condition that a value(String) is in the societies array.
So, if I get, "4e59693a9df7a393a15388e7', passed to the my Java method, how do I go about creating a Query utilizing the Criteria object.
I tried the following, but it obviously doesn't work:
Query filter = new Query(Criteria.where(socid).in("societies")); //socid = 4e59693a9df7a393a15388e7


Reply With Quote
