Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cedric05/rust-bson
https://github.com/cedric05/rust-bson
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/cedric05/rust-bson
- Owner: cedric05
- Created: 2022-08-12T04:35:20.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-13T05:40:40.000Z (over 2 years ago)
- Last Synced: 2024-10-05T23:21:29.389Z (3 months ago)
- Language: Rust
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bson
Encoding and decoding support for BSON in Rust
## Overview of the BSON Format
BSON, short for Binary JSON, is a binary-encoded serialization of JSON-like documents.
Like JSON, BSON supports the embedding of documents and arrays within other documents
and arrays. BSON also contains extensions that allow representation of data types that
are not part of the JSON spec. For example, BSON has a datetime type and a binary data type.```text
// JSON equivalent
{"hello": "world"}// BSON encoding
\x16\x00\x00\x00 // total document size
\x02 // 0x02 = type String
hello\x00 // field name
\x06\x00\x00\x00world\x00 // field value
\x00 // 0x00 = type EOO ('end of object')
```BSON is the primary data representation for [MongoDB](https://www.mongodb.com/), and this crate is used in the
[`mongodb`](https://docs.rs/mongodb/latest/mongodb/) driver crate in its API and implementation.For more information about BSON itself, see [bsonspec.org](http://bsonspec.org).