Agenda
MongoClient mongo
= new MongoClient ("hostname", 27017);
DB db = mongo.getDB("dataqueuenode");
DBCollection collection = db.getCollection("entity");
BasicDBObject query = new BasicDBObject();
query.put("type" , "S2F");
query.put("subtype" , "SQL Orders");
query.put("state" , "disputed");
collection.findone(DBObject o); // search one specific record
collection.find(DBObject o); //search all specific records
collection.remove(DBObject o); // remove specific records
collection.insert(DBObject arr); // insert record
collection.update(DBObject q , DBObject o ); //update record
* @param q the selection criteria for the update
* @param o the modifications to apply
Reference
doc: http://docs.mongodb.org/manual/core/crud-introduction
MongoVUE
MongoDB中条件操作符有:
原文:http://www.cnblogs.com/huaxiong/p/4721317.html