Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
March 29, 2022 07:45 pm GMT

Something short about MongoDB

I have worked with relational databases particularly MySQL and later on MariaDB.

So recently I decided to check out MongoDB and test the NoSQL world for a bit. Still there is much for me to learn.

MongoDB is a NoSQL, document oriented, cross platform database program. MongoDB uses JSON-like (Binary JSON - BSON) documents with optional schemas. Apparently the word MongoDB is derived from two words Humongous Database

NoSQL databases store data differently than relational tables, specifically they dont have tables.

MongoDB stores data records as documents (specifically BSON documents) which are gathered together in collections. A database stores one or more collections of documents. Collections are analogous to tables in relational databases.

According to Wikipedia MongoDB comes in three editions MongoDB Community Server, MongoDB Enterprise Server and MongoDB Atlas

MongoDB Community Server
The MongoDB Community Edition is free and available for Windows, Linux, and macOS.

MongoDB Enterprise Server
MongoDB Enterprise Server is the commercial edition of MongoDB, available as part of the MongoDB Enterprise Advanced subscription.

MongoDB Atlas
MongoDB is also available as an on-demand fully managed service. MongoDB Atlas runs on AWS, Microsoft Azure, and Google Cloud Platform.

Restrictions on Database names
Database names are case-sensitive in MongoDB but they must also differ on more than just case otherwise you will get an error.
Database names for deployments running on Windows systems cannot contain any of the following characters: /. "$*<>:|? While those deployed on Linux/Unix systems cannot contain any of the following characters: /. "$
Database names cannot be empty and must have fewer than 64 characters.

Restriction on Collection Names
Collection names should begin with an underscore or a letter character, and cannot: contain the $, be an empty string, contain the null character, and begin with the system prefix.

Restrictions on Field Names
Field names cannot contain the null character.
The field name _id is reserved for use as a primary key; its value must be unique in the collection, is immutable, and may be of any type other than an array. If the _id contains subfields, the subfield names cannot begin with a ($) symbol.

The MongoDB Shell a.k.a mongosh is an interactive environment for interacting with MongoDB deployments, from here you can issue commands to query and interact with your database.

References
https://www.mongodb.com/docs
https://en.wikipedia.org/wiki/MongoDB


Original Link: https://dev.to/mmk2020/something-short-about-mongodb-3eap

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To