Nebojša Cvetković
Nebojša Cvetković
Yes, internally. `json/include/nlohmann/detail/output/binary_writer.hpp`: ```diff // json/include/nlohmann/detail/output/binary_writer.hpp void write_ubjson(const BasicJsonType& j, const bool use_count, const bool use_type, const bool add_prefix = true, - const bool use_bjdata = false) + const bjdata_version_t...
Ah right - yes, but if anything I would deprecate `to_ubjson` in favour of `to_bjdata` considering UBJSON has not seen any meaningful updates in ~8 years. If we can play...
The change in endianness between UBJSON/BJData makes it feel like more than just a dialect to me so I'd fear labelling it as such (and having both use `to_ubjson`) would...
That unfortunately leaves `to_bjdata(j, true, true, nlohmann::json::bjdata_version_t::draft3)` looking rather verbose. Possible alternatives are: 1. `to_bjdata(j, bjdata_config_t { size, type, version } )`, nice because we can default version to 3...
> ADL should allow you to write to_bjdata(j, true, true, bjdata_version_t::draft3). Still not nice, but at least shorter. Didn't realize ADL let you do this, that's not so bad. >...
Thanks for the assistance!
I believe if an ID value is provided (in `insert()`/`save()`/etc) it will be saved to the database and will not be overwritten by the generator, have you been experiencing otherwise?
See https://github.com/microsoft/TypeScript/issues/40451 for proposed further improvements and currently possible alternatives
Please backport to `v5.3` when merged.
The input is using [optimized binary arrays](https://github.com/NeuroJSON/bjdata/blob/master/Binary_JData_Specification.md#optimized-binary-array) which are a feature in BJData draft 3. This has to be explicitly enabled in [to_bjdata](https://json.nlohmann.me/api/basic_json/to_bjdata/).