テキスト、BSON、またはUBJSONとして格納されているJSONには、ストレージ形式の仕様に応じて特定のデータ型を含めることができます。次のテーブルは、各バイナリ ストレージの仕様とその他すべての仕様の対応表現の拡張データ型すべてを示します。
| ソース指定 | ソース タイプ | ターゲット指定 | ターゲット タイプ |
|---|---|---|---|
| BSON | 浮動小数点 | JSON | 数値 |
| UBJSON | float32/float64 | ||
| バイナリ データ | JSON/UBJSON | キーと値のペア: {"$type": <string representing type of binary data>,
"$binary": <string representing binary data>}
|
|
| ObjectId | JSON/UBJSON | キーと値のペア: {"$oid": <string representing object id>}
|
|
| UTC日時 | JSON/UBJSON | キーと値のペア: {"$date": <number representing date>}
|
|
| 正規表現 | JSON/UBJSON | キーと値のペア: {"$regex": < string representing regex>,
"$options": <string representing options>}
|
|
| DBPointer | JSON/UBJSON | キーと値のペア: {"$ref": <string representing collection>,
"$id": <string representing object id>}
|
|
| JavaScriptCode | JSON/UBJSON | 文字列 | |
| 記号 | JSON/UBJSON | 文字列 | |
| JavaScriptコード(スコープあり) | JSON/UBJSON | 文字列 | |
| タイムスタンプ | JSON/UBJSON | キーと値のペア: {"$timestamp": {
"$t": <number representing timestamp>,
"$i": <number representing increment>} }
|
|
| Minキー | JSON/UBJSON | キーと値のペア: {"$minKey": 1}
|
|
| Maxキー | JSON/UBJSON | キーと値のペア: {"$maxKey": 1}
|
|
| int32 | JSON | 数値 | |
| UBJSON | int32 | ||
| int64 | JSON | 数値 | |
| UBJSON | int64 | ||
| UBJSON | int8 | JSON | 数値 |
| BSON | int32 | ||
| int16 | JSON | 数値 | |
| BSON | int32 | ||
| int32 | JSON | 数値 | |
| BSON | int32 | ||
| int64 | JSON | 数値 | |
| BSON | int64 | ||
| float32 | JSON | 数値 | |
| BSON | double | ||
| float64 | JSON | 数値 | |
| BSON | double | ||
| 高精度な数 | JSON/BSON | 文字列 | |
| char | JSON/BSON | 文字列 |