[6] 
[DFN[BSON]]
は
[[MongoDB]]
の[[データ形式]]の1つです。

[7] 
[[BSON]]
は
Binary JSON
の略とされていますが、
[[JSON]] とは特に関係ない [[JSONもどき]]の一種です。

* 仕様書


[1] [CITE[BSON - Binary JSON]]
( ([TIME[2014-03-24 14:09:10 +09:00]] 版))
<http://bsonspec.org/>

[9] [CITE@en[specifications/subtype6.rst at master · mongodb/specifications · GitHub]], [TIME[2023-04-17T05:20:42.000Z]] <https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/subtype6.rst>


* データ型

[3] 
[[正規表現]],
[[UUID]],
[[MD5]],
[[JavaScriptコード]]

** BSON における日時

[5] 次の2つの[[日時データ型]]があります [SRC[>>1]]。

>UTC datetime - The int64 is UTC milliseconds since the Unix epoch.
>Timestamp - Special internal type used by MongoDB replication and sharding. First 4 bytes are an increment, second 4 are a timestamp.

[8] 
[DFN[UTC datetime]] は[[ミリ秒Unix time]]。

[10] [[MongoDB Extended JSONにおける日時]]も参照。

[11] 
[CITE@en[BSON Types — MongoDB Manual]], [TIME[2023-04-07T17:37:20.000Z]], [TIME[2023-04-17T06:13:40.927Z]] <https://www.mongodb.com/docs/manual/reference/bson-types/#timestamps>


* 実装

[2] [CITE@en[GitHub - mongodb/js-bson: BSON Parser for node and browser]], [TIME[2021-09-21T06:34:29.000Z]] <https://github.com/mongodb/js-bson>

* 関連

[4] [[MongoDB Extended JSON]]


* メモ