...

Text file src/go.mongodb.org/mongo-driver/testdata/bson-corpus/dbpointer.json

Documentation: go.mongodb.org/mongo-driver/testdata/bson-corpus

     1{
     2    "description": "DBPointer type (deprecated)",
     3    "bson_type": "0x0C",
     4    "deprecated": true,
     5    "test_key": "a",
     6    "valid": [
     7        {
     8            "description": "DBpointer",
     9            "canonical_bson": "1A0000000C610002000000620056E1FC72E0C917E9C471416100",
    10            "canonical_extjson": "{\"a\": {\"$dbPointer\": {\"$ref\": \"b\", \"$id\": {\"$oid\": \"56e1fc72e0c917e9c4714161\"}}}}",
    11            "converted_bson": "2a00000003610022000000022472656600020000006200072469640056e1fc72e0c917e9c47141610000",
    12            "converted_extjson": "{\"a\": {\"$ref\": \"b\", \"$id\": {\"$oid\": \"56e1fc72e0c917e9c4714161\"}}}"
    13        },
    14        {
    15            "description": "DBpointer with opposite key order",
    16            "canonical_bson": "1A0000000C610002000000620056E1FC72E0C917E9C471416100",
    17            "canonical_extjson": "{\"a\": {\"$dbPointer\": {\"$ref\": \"b\", \"$id\": {\"$oid\": \"56e1fc72e0c917e9c4714161\"}}}}",
    18            "degenerate_extjson": "{\"a\": {\"$dbPointer\": {\"$id\": {\"$oid\": \"56e1fc72e0c917e9c4714161\"}, \"$ref\": \"b\"}}}",
    19            "converted_bson": "2a00000003610022000000022472656600020000006200072469640056e1fc72e0c917e9c47141610000",
    20            "converted_extjson": "{\"a\": {\"$ref\": \"b\", \"$id\": {\"$oid\": \"56e1fc72e0c917e9c4714161\"}}}"
    21        },
    22        {
    23            "description": "With two-byte UTF-8",
    24            "canonical_bson": "1B0000000C610003000000C3A90056E1FC72E0C917E9C471416100",
    25            "canonical_extjson": "{\"a\": {\"$dbPointer\": {\"$ref\": \"é\", \"$id\": {\"$oid\": \"56e1fc72e0c917e9c4714161\"}}}}",
    26            "converted_bson": "2B0000000361002300000002247265660003000000C3A900072469640056E1FC72E0C917E9C47141610000",
    27            "converted_extjson": "{\"a\": {\"$ref\": \"é\", \"$id\": {\"$oid\": \"56e1fc72e0c917e9c4714161\"}}}"
    28        }
    29    ],
    30    "decodeErrors": [
    31        {
    32            "description": "String with negative length",
    33            "bson": "1A0000000C6100FFFFFFFF620056E1FC72E0C917E9C471416100"
    34        },
    35        {
    36            "description": "String with zero length",
    37            "bson": "1A0000000C610000000000620056E1FC72E0C917E9C471416100"
    38        },
    39        {
    40            "description": "String not null terminated",
    41            "bson": "1A0000000C610002000000626256E1FC72E0C917E9C471416100"
    42        },
    43        {
    44            "description": "short OID (less than minimum length for field)",
    45            "bson": "160000000C61000300000061620056E1FC72E0C91700"
    46        },
    47        {
    48            "description": "short OID (greater than minimum, but truncated)",
    49            "bson": "1A0000000C61000300000061620056E1FC72E0C917E9C4716100"
    50        },
    51        {
    52            "description": "String with bad UTF-8",
    53            "bson": "1A0000000C610002000000E90056E1FC72E0C917E9C471416100"
    54        }
    55    ]
    56}

View as plain text