- Mastering MongoDB 3.x
- Alex Giamas
- 152字
- 2021-08-20 10:10:49
Data types
MongoDB uses BSON, a binary-encoded serialization for JSON documents. BSON extends on JSON data types offering for example, native date and binary data types.
BSON, compared to protocol buffers, allows for more flexible schemas that come at the cost of space efficiency. In general, BSON is space efficient, easy to traverse, and time-efficient in encoding/decoding operations.

In MongoDB, we can have documents with different value types for a given field and distinguish among them in querying using the $type operator.
For example, if we have a balance field in GBP with 32-bit integers and double data types, if the balance has pennies in it or not, we can easily query for all accounts that have a rounded balance with any of the following queries:
db.account.find( { "balance" : { $type : 16 } } );
db.account.find( { "balance" : { $type : "integer" } } );
- 電氣自動化專業英語(第3版)
- 3D Printing with RepRap Cookbook
- TestStand工業自動化測試管理(典藏版)
- 西門子S7-200 SMART PLC從入門到精通
- Getting Started with Containerization
- Dreamweaver CS3網頁設計與網站建設詳解
- 條碼技術及應用
- Enterprise PowerShell Scripting Bootcamp
- 傳感器與自動檢測
- HBase Essentials
- 企業級Web開發實戰
- 超好玩的Python少兒編程
- 系統建模與控制導論
- Flash CS3動畫制作融會貫通
- Arduino創意機器人入門:基于Mind+