...

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

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

     1{
     2    "description": "DateTime",
     3    "bson_type": "0x09",
     4    "test_key": "a",
     5    "valid": [
     6        {
     7            "description": "epoch",
     8            "canonical_bson": "10000000096100000000000000000000",
     9            "relaxed_extjson": "{\"a\" : {\"$date\" : \"1970-01-01T00:00:00Z\"}}",
    10            "canonical_extjson": "{\"a\" : {\"$date\" : {\"$numberLong\" : \"0\"}}}"
    11        },
    12        {
    13            "description": "positive ms",
    14            "canonical_bson": "10000000096100C5D8D6CC3B01000000",
    15            "relaxed_extjson": "{\"a\" : {\"$date\" : \"2012-12-24T12:15:30.501Z\"}}",
    16            "canonical_extjson": "{\"a\" : {\"$date\" : {\"$numberLong\" : \"1356351330501\"}}}"
    17        },
    18        {
    19            "description": "negative",
    20            "canonical_bson": "10000000096100C33CE7B9BDFFFFFF00",
    21            "relaxed_extjson": "{\"a\" : {\"$date\" : {\"$numberLong\" : \"-284643869501\"}}}",
    22            "canonical_extjson": "{\"a\" : {\"$date\" : {\"$numberLong\" : \"-284643869501\"}}}"
    23        },
    24        {
    25            "description" : "Y10K",
    26            "canonical_bson" : "1000000009610000DC1FD277E6000000",
    27            "canonical_extjson" : "{\"a\":{\"$date\":{\"$numberLong\":\"253402300800000\"}}}"
    28        },
    29        {
    30            "description": "leading zero ms",
    31            "canonical_bson": "10000000096100D1D6D6CC3B01000000",
    32            "relaxed_extjson": "{\"a\" : {\"$date\" : \"2012-12-24T12:15:30.001Z\"}}",
    33            "canonical_extjson": "{\"a\" : {\"$date\" : {\"$numberLong\" : \"1356351330001\"}}}"
    34        }
    35    ],
    36    "decodeErrors": [
    37        {
    38            "description": "datetime field truncated",
    39            "bson": "0C0000000961001234567800"
    40        }
    41    ]
    42}

View as plain text