Skip to content

Commit 12d99be

Browse files
committed
Treat 0x11 as uint64 and not timestamp specific
Signed-off-by: Michael Valladolid <[email protected]>
1 parent 4ae54cd commit 12d99be

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

docs/mkdocs/docs/features/binary_formats/bson.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ The library maps BSON record types to JSON value types as follows:
7373
| Symbol | 0x0E | *unsupported* |
7474
| JavaScript Code | 0x0F | *unsupported* |
7575
| int32 | 0x10 | number_integer |
76-
| Timestamp | 0x11 | number_unsigned |
76+
| uint64 | 0x11 | number_unsigned |
7777
| 128-bit decimal float | 0x13 | *unsupported* |
7878
| Max Key | 0x7F | *unsupported* |
7979
| Min Key | 0xFF | *unsupported* |
@@ -94,3 +94,7 @@ The library maps BSON record types to JSON value types as follows:
9494
```json
9595
--8<-- "examples/from_bson.output"
9696
```
97+
98+
!!! note "Handling of BSON type 0x11"
99+
BSON type 0x11 is used to represent uint64 numbers. This library treats these values purely as uint64 numbers
100+
and does not parse them into date-related formats.

tests/src/unit-bson.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ TEST_CASE("BSON")
331331

332332
SECTION("non-empty object with unsigned integer (64-bit) member")
333333
{
334-
// directly encoding uint64 is not supported in bson (only for timestamp values)
335334
json const j =
336335
{
337336
{ "entry", std::uint64_t{0x1234567804030201} }
@@ -531,7 +530,6 @@ TEST_CASE("BSON")
531530

532531
SECTION("Some more complex document")
533532
{
534-
// directly encoding uint64 is not supported in bson (only for timestamp values)
535533
json const j =
536534
{
537535
{"double", 42.5},

0 commit comments

Comments
 (0)