...

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

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

     1{
     2    "description": "Array",
     3    "bson_type": "0x04",
     4    "test_key": "a",
     5    "valid": [
     6        {
     7            "description": "Empty",
     8            "canonical_bson": "0D000000046100050000000000",
     9            "canonical_extjson": "{\"a\" : []}"
    10        },
    11        {
    12            "description": "Single Element Array",
    13            "canonical_bson": "140000000461000C0000001030000A0000000000",
    14            "canonical_extjson": "{\"a\" : [{\"$numberInt\": \"10\"}]}"
    15        },
    16        {
    17            "description": "Single Element Array with index set incorrectly to empty string",
    18            "degenerate_bson": "130000000461000B00000010000A0000000000",
    19            "canonical_bson": "140000000461000C0000001030000A0000000000",
    20            "canonical_extjson": "{\"a\" : [{\"$numberInt\": \"10\"}]}"
    21        },
    22        {
    23            "description": "Single Element Array with index set incorrectly to ab",
    24            "degenerate_bson": "150000000461000D000000106162000A0000000000",
    25            "canonical_bson": "140000000461000C0000001030000A0000000000",
    26            "canonical_extjson": "{\"a\" : [{\"$numberInt\": \"10\"}]}"
    27        },
    28        {
    29            "description": "Multi Element Array with duplicate indexes",
    30            "degenerate_bson": "1b000000046100130000001030000a000000103000140000000000",
    31            "canonical_bson": "1b000000046100130000001030000a000000103100140000000000",
    32            "canonical_extjson": "{\"a\" : [{\"$numberInt\": \"10\"}, {\"$numberInt\": \"20\"}]}"
    33        }
    34    ],
    35    "decodeErrors": [
    36        {
    37            "description": "Array length too long: eats outer terminator",
    38            "bson": "140000000461000D0000001030000A0000000000"
    39        },
    40        {
    41            "description": "Array length too short: leaks terminator",
    42            "bson": "140000000461000B0000001030000A0000000000"
    43        },
    44        {
    45            "description": "Invalid Array: bad string length in field",
    46            "bson": "1A00000004666F6F00100000000230000500000062617A000000"
    47        }
    48    ]
    49}

View as plain text