MongoDB Dev and Admin (17 Blogs) Become a Certified Professional

Introduction to JSON & BSON in MongoDB

Last updated on Apr 22,2020 7.5K Views


What is JSON?

JSON is JavaScript Object Notation. It is a light-weight data interchange format, which can get transferred from one system to the other easily. It is easy to read and write this format. It is also not a complex task for machines to parse and generate. The text format is completely language independent.

At high level, JSON will have two things- An object and an array. An object is a collection of name/value pairs and an array is an ordered list of values.With the combination of two, you can have a complete JSON structure. The maximum amount of documents that one can embed in a document is 100. This is a very important factor while working with MongoDB.

So an object will start with curly braces and end with curly braces and then comes the key and value. An array will start with the normal, non-curly brackets, then comes value and comma. There are data types that can be supported. See the image below to understand it better.

What is BSON?

BSON is nothing but Binary JSON i.e Binary JavaScript Object Notation. Unlike JSON, it is not in a readable format. It supports the embedding of documents and arrays within other documents and arrays. Like JSON, it is easy for machines to parse and generate. For more information on both these topics, you can always get an insight from various sources. When you check the websites for information, you will see the difference in JSON and BSON and understand how different the two are in terms of readability.

Got a question for us? Mention them in the comments section and we will get back to you.

Related Posts:

Understanding Journaling in MongoDB

Get started with MongoDB

Upcoming Batches For MongoDB Certification Training Course
Course NameDate
MongoDB Certification Training Course

Class Starts on 4th February,2023

4th February

SAT&SUN (Weekend Batch)
View Details
MongoDB Certification Training Course

Class Starts on 22nd April,2023

22nd April

SAT&SUN (Weekend Batch)
View Details
Comments
0 Comments

Join the discussion

Browse Categories

webinar REGISTER FOR FREE WEBINAR
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP

Subscribe to our Newsletter, and get personalized recommendations.

image not found!
image not found!

Introduction to JSON & BSON in MongoDB

edureka.co