Mongo Db M101 JS

Beschreibung

Notiz am Mongo Db M101 JS, erstellt von Muhammad Akif am 06/01/2018.
Muhammad Akif
Notiz von Muhammad Akif, aktualisiert more than 1 year ago
Muhammad Akif
Erstellt von Muhammad Akif vor fast 7 Jahre
17
0

Zusammenfassung der Ressource

Seite 1

What is mongo db? MongoDb document based no-sql database. To query mongodb we use json. Benefits:  i) Programmers only need to create a data model that fits there application. ii) mongodb predicates on data models to it is easy to shard data or distribute data on multiple servers. iii) Supports scaling out feature. iv) We dont need to depend on deployment model.it can deployed easily on one server or one node,a few nodes or a hundred of shards. v)  In MongoDB, a write operation is atomic on the level of a single document, even if the operation modifies multiple embedded documents within a single document.When a single write operation modifies multiple documents, the modification of each document is atomic, but the operation as a whole is not atomic and other operations may interleave.

Seite 2

Mongo Shell Node js communicate with mongodb using v8 js. V8 is written in c++. Other way to communicate with mongo db is through mongo shell which is written in c++  when we enter commands it interprets using its own v8 bindings.

Seite 3

BSON(Binary JSON): Node js communicate with mongo db using bson data format. mongo send and  receive data in bson format. 1)Lightweight  2) Traversable. 3) Efficient Difference between json and bson is that bson support more datatypes as compare to json. If you create a new document without an _id field, MongoDB automatically creates the field and assigns a unique BSON ObjectId. BSON plays the role of a canonical (i.e., "unique") representation of documents shared across all drivers and tools.

Seite 4

CURD using a mongo db query language. db is a global variable used to set current database. help command used check available commands. use  now db point to dbname. switched to defined db. if exist only switch otherwise create new  db. same with collections. find() return all documents. find({}) return all documents. find({your constraints}); returned all records matching constraints. Find command is only a array of document but it is a cursor object. Shell is a javascript interpreter we can write javascript in the shell. var c = db.collection.find(); return a cursor to records which is stored in variable c; c.hasNext(); return true if next record is available and false if no row in next. c.next(); return that document.

Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

Architecture and Science Connections
JoseAmbassador
Structure and Function of Lymph Node and Spleen
Matthew Coulson
Node.Js
Kyle Peters
Making my app
johngalt
Getting started with Node and Mongo
James Drummond
Architecture and Science Connections
M Sirsi
Einstufungstest Italienisch Niveau A2.2
SprachschuleAktiv
KPOL-Fragen
Lisa-Maria Hauschild
Stochastik
elouasdi98
GPSY SOPS
Simon Wirsching
Chirurgie Rind Vetie
Anne Käfer