MongoDB BSON and JSON Detail-Programmershelpers

0
172
Spread the love

 Introduction

In this article, we learn MongoDB BSON and JSON working.

Prerequisite

It will good to cover my below articles before this.It helps to learn more about MongoDB.In which I explained.Click here How can Manage Reference in MongoDB and MongoDB Replication working.

Wha is BSON

BSON stands for Binary javascript object notation. BSON always binary formate <01010101 or 11111111.MongoDB uses BSON to store the document.Like BSON and JSON support embedded document in the array.BSON also supported data types that are not part of JSON.

BSON support the following data types.
  1. Double: Eight byte is equal to 64 bit for floating point.
  2. int64: 8 byte is equal to 64 bit.
  3. int32: Four type 32 bits.
  4. Byte: One byte is equal to eight bits.
Since the Binary JSON 
  • Lightweight
  • Traversable
  • Efficient
  • Fast scalability
  • Data types

The MongoDB drivers send and receive data in BSON. And however, the MongoDB even stores data as BSON Object. Since encoding data to BSON and decoding data from BSON can be performed very quickly and hence it is highly efficient also.

Alt tag MongoDB BSON

Wha is JSON

Javascript object notation(JSON) open data interchange formate.It is language independent.Use the convention of c  family language java javascript and Perl python.support the basic data types string boolean value array.

  • Lightweight and interchange formate
  • Easy for human read and write.easy for machine to parse and generate
  • Text format that completely language independent

Jason data consists of <object> and <array>.Data in a document is the form of key and value pair.Data is separated by commas.Curly bracket {  } hold objects. Box bracket [] represent the array.

Here is an example of JSON formate.

Conclusion

I wish I could tell you that a great site of MongoDB.you just understands key element above post-MongoDB BSON and JSON working. more, detail about MongoDB BSON, please click here BSON AND JSON working.You also read my previous lecture.I hope you will understand this lecture.Thank you for reading this lecture. Hope you got the idea. please share it.