MongoDB Extended JSON

MongoDB Extended JSON

[5] MongoDB Extended JSONMongoDBデータ形式の1つです。

[6] BSON のデータモデルに相当するものを、 JSON応用として、 または JSON っぽい独自ファイル形式で、 の2通りの方法で記述できます。 前者は JSON ですが、後者は JSONもどきです。

仕様書

[1] MongoDB Extended JSON — MongoDB Manual 2.6.7 ( 版) http://docs.mongodb.org/manual/reference/mongodb-extended-json/

MongoDB Extended JSON

JSON can only represent a subset of the types supported by BSON. To preserve type information, MongoDB adds the following extensions to the JSON format:

Strict mode. Strict mode representations of BSON types conform to the JSON RFC. Any JSON parser can parse these strict mode representations as key/value pairs; however, only the MongoDB’s internal JSON parser also recognizes the type information conveyed by the format.

mongo Shell mode. The MongoDB’s internal JSON parser and the mongo shell can parse this mode.

[4] MongoDB Extended JSON (v1) — MongoDB Manual, , https://www.mongodb.com/docs/manual/reference/mongodb-extended-json-v1/

JSON can only represent a subset of the types supported by BSON. To preserve type information, MongoDB adds the following extensions to the JSON format:

[3] MongoDB Extended JSON (v2) — MongoDB Manual, , https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/

データ型

[7] 正規表現

日時

[9] v1 の data_dateISO 8601のプロファイル (パターン型の例示により規定) またはミリ秒Unix time>>4

[11] v2 の DateRFC 3339の日時形式のプロファイルまたはミリ秒Unix time>>3

[12] ここで、 RFC 3339 形式を使えるのはが [ 1970, 9999 ] のとき。 秒の小数部は、 0 のとき省略するべき。 そうでないときちょうど3桁。 >>3

[10] v1 の data_timestamp, v2 の TimestampUnix time>>4, >>3

[8] BSONにおける日時も参照.

関連

[2] 関連: BSON

メモ