Hi everyone,I'm a newbie to MongoDB .. I was playing around with the MongoDB shell, and then I was going through the Java driver .. and I couldn't really find a way to execute a query like "db.things.find({j: {$ne: 3}, k: {$gt: 10} })" from the Java library. I saw the "eval" is there to execute a whole function, but I saw that it is not recommended to use because of some of its limitations. So my requirement is basically, I want an user to dynamically send a query to my Java application to retrieve some data .. so there should be some querying mechanism, and couldn't really use the Java library methods to build up the query at that time. Greatly appreciate if someone can give me a suggestion on how to do this.Cheers,Anjana.
import static com.allanbank.mongodb.builder.QueryBuilder.where
DocumentAssignable query = where("f").greaterThan(23).lessThan(42)
.and("g").lessThan(3);
I'm a newbie to MongoDB .. I was playing around with the MongoDB shell, and then I was going through the Java driver .. and I couldn't really find a way to execute a query like "db.things.find({j: {$ne: 3}, k: {$gt: 10} })" from the Java library. I saw the "eval" is there to execute a whole function, but I saw that it is not recommended to use because of some of its limitations. So my requirement is basically, I want an user to dynamically send a query to my Java application to retrieve some data .. so there should be some querying mechanism, and couldn't really use the Java library methods to build up the query at that time. Greatly appreciate if someone can give me a suggestion on how to do this.