Skip to content

Instantly share code, notes, and snippets.

@siddrc
Last active June 10, 2018 07:22
Show Gist options
  • Save siddrc/c430d0a3962795d98b4ba9871703631a to your computer and use it in GitHub Desktop.
Save siddrc/c430d0a3962795d98b4ba9871703631a to your computer and use it in GitHub Desktop.
An Intro to MongoDB

mongodb

Official Website

http://www.mongodb.com


Mongodb is a OODBMS, ie a object oriented database management system, where in data is stored in terms of objects instead of conventional rows. Mongodb is also being called as a No-SQL database because we do not use any SQL syntax Official Documentation is available at
https://docs.mongodb.com/manual/crud/

SQL Jargons in Mongodb

For understanding SQL terms in mongoDB sense, please read the link mentioned below.
https://docs.mongodb.com/manual/reference/sql-comparison/

Please note:

Please bear in mind,as of version 3.6 Mongodb does not support TRANSACTIONS, but supports ACID at a document level.
Mongodb 4.0 which will be released this year hopefully, will have support for transactions.

More Info

To understand what are database transactions and ACID properties please read the links below.
This link talks about ACID
https://msdn.microsoft.com/en-in/library/aa480356.aspx
So,ACID is a specification, any company that makes a Database, must choose to follow this or else the resulting database becomes a failure when used by Enterprise level applications.(ACID is a valid interview question)
Database Transactions are as follows.

database-tx


ACID is also a valid interview question.

On Another note

Also, Mongodb does not support joins till version 3.2 but post 3.2 mongodb has a $lookup operator, which is a partial implementation of a join, which means that if you delete a parent-id and if this parentidid has children , mongodb will ALLOW IT, it is the developer's responsibility to not allow the user to do such a operation.
https://docs.mongodb.com/manual/tutorial/model-tree-structures-with-child-references/

Schema Design rules


Here are some design rules(The link below has 3 parts, I have attached only part-1, the content in the link has links to the other two parts as well.)
https://www.mongodb.com/blog/post/6-rules-of-thumb-for-mongodb-schema-design-part-1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment