时间:2021-07-01 10:21:17 帮助过:2人阅读
= 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");
Query Documentcollection.findone(DBObject o); // search one specific record
collection.find(DBObject o); //search all specific records
Remove Documentcollection.remove(DBObject o); // remove specific records
Insert Documentcollection.insert(DBObject arr); // insert record
Modify Documentcollection.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中条件操作符有:
mongoDB知识汇总
标签: