Skip to Content
MongoDB权威指南(第3版)
book

MongoDB权威指南(第3版)

by Shannon Bradshaw, Eoin Brazil, Kristina Chodorow
November 2021
Intermediate to advanced
410 pages
12h 1m
Chinese
Posts & Telecom Press
Content preview from MongoDB权威指南(第3版)
384
附录B
深入
MongoDB
如果只想高效地使用
MongoDB
,那么并不需要了解
MongoDB
的内部机制,但是对于相
关工具的开发者、代码贡献者,或仅仅希望了解底层机制的开发者来说,他们可能会感
兴趣。本附录包含了一些相关的基础内容。
MongoDB
源代码可以在
https://github.com/
mongodb/mongo
上找到。
B.1
 
BSON
MongoDB
中的文档是一个抽象概念,即文档的具体表示形式取决于所使用的驱动程序和
编程语言。因为在
MongoDB
中文档被广泛地用于通信
,所以
MongoDB
生态系统中的所
有驱动程序、工具和进程都需要文档的表示形式。这种表示形式被称为二进制
JSON
BSON
(没人知道
J
去哪儿了)
BSON
是一种轻量的二进制格式
,能够将任何
MongoDB
文档表示为一串字节。数据库可
以理解
BSON
格式,而
BSON
也是文档保存到磁盘中的格式。
当驱动程序使用文档进行插入、查询或其他操作时,会在发送到服务器之前将该文档编码
BSON
同样,从服务器返回给客户端的文档也是以
BSON
字符串的形式发送的。在返
回给客户端之前,驱动程序会将
BSON
数据解码为其本地文档的表示形式。
BSON
格式有
3
个主要目标。
高效
BSON
的设计可以高效地表示数据
,而不需要使用太多额外的空间。在最坏的情况下,
BSON
的效率略低于
JSON
,而在最好的情况下
(例如,存储二进制数据或大数字时),
它的效率要高得多。
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

大数据项目管理:从规划到实现

大数据项目管理:从规划到实现

Ted Malaska, Jonathan Seidman
Go程序设计语言

Go程序设计语言

艾伦A. A.多诺万, 布莱恩W. 柯尼汉
Spark快速大数据分析(第2版)

Spark快速大数据分析(第2版)

Jules S. Damji, Brooke Wenig, Tathagata Das, Denny Lee
Kafka权威指南(第2版)

Kafka权威指南(第2版)

Gwen Shapira, Todd Palino, Rajini Sivaram, Krit Petty

Publisher Resources

ISBN: 9787115576538