basically this is my question: How to query MongoDB with "like"?
but i guess all the answers in here are applicable when you are using mongodb shell command line, so what is the equivalent for db.users.find({"name": /.*m.*/})
when we are using java.
here is how i am trying to do
DBCollection coll = MongoDBUtil.getDB().getCollection("post_details"); BasicDBObject query = new BasicDBObject(); query.put("price", new BasicDBObject("$gt", 5).append("$lt", 8));
/*what should i write instead of this line*/
query.put("title", "/.*m.*/");
DBCursor cur = coll.find(query);