joplin-notes/joplin notion extension/Web Development/NOSQL/mongodb/Theory.md
2026-11-04 00:33:23 +05:30

1.8 KiB

Theory https://www.youtube.com/playlist?list=PL4cUxeGkcC9h77dJ-QJlwGlZlTd4ecZOA

  • relational database 1 author can have many books whose information are stored in the other table named Books. 9a6a085c63fcaeb121f425de0d03d4b0.png So we have rows,columns, table and joining Columns is property and we use sql queries to use them

  • non relational database Here instead of rows, columns and tables we use collections and documents Each collection store a specific type of data record like users, authors and books.These records inside collections are called documents So users is collection unlike table in sql. and instead of containing columns and rows it contains document which is more like js object 2edcc32c60246452cda407c2da2e3c18.png Here author field has nested object. in sql we would have to use other table for that.

Installation

Collections and Documents 1a819c18ab7dea9f21918c9abcfae274.png Mongodb stores data in BSON which is Binary JSON and returns result in JSON. Each document has a property _id which is assigned automatically by mongodb and its data type is 'ObjectId'.