头匹配:
{"title":new RegExp("^各地发起纪念周总理")}
任意位置匹配:
{"published":{$gte: "2013-05-01", $lt: "2013-06-10"}, "title":new RegExp(".*北京.*")}
{"published":{$gte: "2013-05-01", $lt: "2013-06-10"}}
{"published":{$gte: "2013-05-01", $lt: "2013-06-10"}, "title":new RegExp("^北京")}
find: {"user.screen_name":"_juliannemoore","retweeted_status":null,
"in_reply_to_status_id_str":null,"text":new RegExp(".*@.*")}
fields: {"_id":false, "text":true}
BasicDBObject query = new BasicDBObject();
query.put("published", new BasicDBObject("$gte", "2013-05-01").append("$lt", "2013-06-11"));
query.put("title", new BasicDBObject("$regex", ".*北京.*"));
DBObject query = new BasicDBObject();
query.put("id", Long.parseLong("510842471837097985"));
query.put("entities.user_mentions.screen_name", "liyakebede");
DBObject update = new BasicDBObject();
update.put("$set", new BasicDBObject("entities.user_mentions.$.link_type","friend"));
WriteResult result = col.update(query, update);