xxxxxxxxxx
Simple database that is easy to use due to its schemaless structure
xxxxxxxxxx
MongoDB is a general purpose,
document-based,
distributed database
built for modern application developers and for the cloud era.
No database makes you more productive.
MongoDB is a popular document-oriented NoSQL database. MongoDB is designed to store and retrieve data in a flexible, schema-less format called BSON (Binary JSON), which is similar to JSON documents.
xxxxxxxxxx
MongoDB is a cross-platform document-oriented database program.
Classified as a NoSQL database program,
MongoDB uses JSON-like documents with optional schemas.
MongoDB is developed by MongoDB Inc.
MongoDB is licensed under the Server Side Public License,
which is deemed non-free by several distributions
xxxxxxxxxx
1 db.coll.insertOne({name: "Max"})
2 db.coll.insert([{name: "Max"}, {name:"Alex"}]) // ordered bulk insert
3 db.coll.insert([{name: "Max"}, {name:"Alex"}], {ordered: false}) // unordered bulk insert
4 db.coll.insert({date: ISODate()})
5 db.coll.insert({name: "Max"}, {"writeConcern": {"w": "majority", "wtimeout": 5000}})
xxxxxxxxxx
MongoDB is a source-available cross-platform document-oriented database program.
Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas.
MongoDB is developed by MongoDB Inc. and licensed under the Server Side Public License.
- Wikipedia
xxxxxxxxxx
mongodb shell -> you need this for type command, go to mongodb center download it
Command:
+ show dbs -> display all db in local/server
+ insertOne -> insert one row to db
db.users.insertOne({name: 'vilh', lang:['php', 'c#'], addr: {zip: 201, country: 'VietNam'} })
xxxxxxxxxx
1)MongoDb is noSql database.Each databse contain one or more collectoin(table in sql).
2)Each collection contains one or more Document(rows in sql).one post one user
3)Document in sense it stores in field-value pait data structure.
How to install mongoose in nodejs using npm
xxxxxxxxxx
$ npm install mongoose --save