bson/testdata/bson-corpus/dbpointer.json
2025-03-17 20:58:26 +01:00

57 lines
2.8 KiB
JSON

{
"description": "DBPointer type (deprecated)",
"bson_type": "0x0C",
"deprecated": true,
"test_key": "a",
"valid": [
{
"description": "DBpointer",
"canonical_bson": "1A0000000C610002000000620056E1FC72E0C917E9C471416100",
"canonical_extjson": "{\"a\": {\"$dbPointer\": {\"$ref\": \"b\", \"$id\": {\"$oid\": \"56e1fc72e0c917e9c4714161\"}}}}",
"converted_bson": "2a00000003610022000000022472656600020000006200072469640056e1fc72e0c917e9c47141610000",
"converted_extjson": "{\"a\": {\"$ref\": \"b\", \"$id\": {\"$oid\": \"56e1fc72e0c917e9c4714161\"}}}"
},
{
"description": "DBpointer with opposite key order",
"canonical_bson": "1A0000000C610002000000620056E1FC72E0C917E9C471416100",
"canonical_extjson": "{\"a\": {\"$dbPointer\": {\"$ref\": \"b\", \"$id\": {\"$oid\": \"56e1fc72e0c917e9c4714161\"}}}}",
"degenerate_extjson": "{\"a\": {\"$dbPointer\": {\"$id\": {\"$oid\": \"56e1fc72e0c917e9c4714161\"}, \"$ref\": \"b\"}}}",
"converted_bson": "2a00000003610022000000022472656600020000006200072469640056e1fc72e0c917e9c47141610000",
"converted_extjson": "{\"a\": {\"$ref\": \"b\", \"$id\": {\"$oid\": \"56e1fc72e0c917e9c4714161\"}}}"
},
{
"description": "With two-byte UTF-8",
"canonical_bson": "1B0000000C610003000000C3A90056E1FC72E0C917E9C471416100",
"canonical_extjson": "{\"a\": {\"$dbPointer\": {\"$ref\": \"é\", \"$id\": {\"$oid\": \"56e1fc72e0c917e9c4714161\"}}}}",
"converted_bson": "2B0000000361002300000002247265660003000000C3A900072469640056E1FC72E0C917E9C47141610000",
"converted_extjson": "{\"a\": {\"$ref\": \"é\", \"$id\": {\"$oid\": \"56e1fc72e0c917e9c4714161\"}}}"
}
],
"decodeErrors": [
{
"description": "String with negative length",
"bson": "1A0000000C6100FFFFFFFF620056E1FC72E0C917E9C471416100"
},
{
"description": "String with zero length",
"bson": "1A0000000C610000000000620056E1FC72E0C917E9C471416100"
},
{
"description": "String not null terminated",
"bson": "1A0000000C610002000000626256E1FC72E0C917E9C471416100"
},
{
"description": "short OID (less than minimum length for field)",
"bson": "160000000C61000300000061620056E1FC72E0C91700"
},
{
"description": "short OID (greater than minimum, but truncated)",
"bson": "1A0000000C61000300000061620056E1FC72E0C917E9C4716100"
},
{
"description": "String with bad UTF-8",
"bson": "1A0000000C610002000000E90056E1FC72E0C917E9C471416100"
}
]
}