1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
44
  
45
  
46
  
47
  
48
  
49
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
57
  
58
  
59
  
60
  
61
  
62
  
63
  
64
  
65
  
66
  
67
  
68
  
69
  
70
  
71
  
72
  
73
  
74
  
75
  
76
  
77
  
78
  
79
  
80
  
81
  
82
  
83
  
84
  
85
  
86
  
{ 
    "description": "Binary type", 
    "bson_type": "0x05", 
    "test_key": "x", 
    "valid": [ 
        { 
            "description": "subtype 0x00 (Zero-length)", 
            "canonical_bson": "0D000000057800000000000000", 
            "canonical_extjson": "{\"x\" : { \"$binary\" : {\"base64\" : \"\", \"subType\" : \"00\"}}}" 
        }, 
        { 
            "description": "subtype 0x00 (Zero-length, keys reversed)", 
            "canonical_bson": "0D000000057800000000000000", 
            "canonical_extjson": "{\"x\" : { \"$binary\" : {\"base64\" : \"\", \"subType\" : \"00\"}}}", 
            "degenerate_extjson": "{\"x\" : { \"$binary\" : {\"subType\" : \"00\", \"base64\" : \"\"}}}" 
        }, 
        { 
            "description": "subtype 0x00", 
            "canonical_bson": "0F0000000578000200000000FFFF00", 
            "canonical_extjson": "{\"x\" : { \"$binary\" : {\"base64\" : \"//8=\", \"subType\" : \"00\"}}}" 
        }, 
        { 
            "description": "subtype 0x01", 
            "canonical_bson": "0F0000000578000200000001FFFF00", 
            "canonical_extjson": "{\"x\" : { \"$binary\" : {\"base64\" : \"//8=\", \"subType\" : \"01\"}}}" 
        }, 
        { 
            "description": "subtype 0x02", 
            "canonical_bson": "13000000057800060000000202000000FFFF00", 
            "canonical_extjson": "{\"x\" : { \"$binary\" : {\"base64\" : \"//8=\", \"subType\" : \"02\"}}}" 
        }, 
        { 
            "description": "subtype 0x03", 
            "canonical_bson": "1D000000057800100000000373FFD26444B34C6990E8E7D1DFC035D400", 
            "canonical_extjson": "{\"x\" : { \"$binary\" : {\"base64\" : \"c//SZESzTGmQ6OfR38A11A==\", \"subType\" : \"03\"}}}" 
        }, 
        { 
            "description": "subtype 0x04", 
            "canonical_bson": "1D000000057800100000000473FFD26444B34C6990E8E7D1DFC035D400", 
            "canonical_extjson": "{\"x\" : { \"$binary\" : {\"base64\" : \"c//SZESzTGmQ6OfR38A11A==\", \"subType\" : \"04\"}}}" 
        }, 
        { 
            "description": "subtype 0x05", 
            "canonical_bson": "1D000000057800100000000573FFD26444B34C6990E8E7D1DFC035D400", 
            "canonical_extjson": "{\"x\" : { \"$binary\" : {\"base64\" : \"c//SZESzTGmQ6OfR38A11A==\", \"subType\" : \"05\"}}}" 
        }, 
        { 
            "description": "subtype 0x80", 
            "canonical_bson": "0F0000000578000200000080FFFF00", 
            "canonical_extjson": "{\"x\" : { \"$binary\" : {\"base64\" : \"//8=\", \"subType\" : \"80\"}}}" 
        }, 
        { 
            "description": "$type query operator (conflicts with legacy $binary form with $type field)", 
            "canonical_bson": "1F000000037800170000000224747970650007000000737472696E67000000", 
            "canonical_extjson": "{\"x\" : { \"$type\" : \"string\"}}" 
        }, 
        { 
            "description": "$type query operator (conflicts with legacy $binary form with $type field)", 
            "canonical_bson": "180000000378001000000010247479706500020000000000", 
            "canonical_extjson": "{\"x\" : { \"$type\" : {\"$numberInt\": \"2\"}}}" 
        } 
    ], 
    "decodeErrors": [ 
        { 
            "description": "Length longer than document", 
            "bson": "1D000000057800FF0000000573FFD26444B34C6990E8E7D1DFC035D400" 
        }, 
        { 
            "description": "Negative length", 
            "bson": "0D000000057800FFFFFFFF0000" 
        }, 
        { 
            "description": "subtype 0x02 length too long ", 
            "bson": "13000000057800060000000203000000FFFF00" 
        }, 
        { 
            "description": "subtype 0x02 length too short", 
            "bson": "13000000057800060000000201000000FFFF00" 
        }, 
        { 
            "description": "subtype 0x02 length negative one", 
            "bson": "130000000578000600000002FFFFFFFFFFFF00" 
        } 
    ] 
}