Agenda
Agility,scalability,high-performancefree and Open-sourcenosql databasejson-likedocument-oriented database (schema Flexible)
A record in MongoDB was a document, which is a data structure composed of field and value pairs. MongoDB is similar to JSON objects.
- SQL to MongoDB Mapping Chart
The following table presents the various SQL terminology and concepts and the corresponding MongoDB terminology and CONCEP Ts.
MongoDB default port is 27017, and the default local host is 127.0.0.1
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");
Query Document
Collection.findone (DBObject o); Search one specific record
Collection.find (DBObject o); Search all specific records
Remove Document
Collection.remove (DBObject o); Remove specific records
Insert Document
Collection.insert (DBObject arr); Insert Record
Modify Document
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
The condition operators in MongoDB are:
- (>) Greater than-$GT
- (<) less than-$lt
- (>=) greater than or equal to-$gte
- (<=) less than or equal to-$lte
>db.testtable.find ({age: {$gt: 22}})
MongoDB Knowledge Summary