You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Round-trip encoding/decoding with js-bson works great, but I am having a rough time trying to exchange data with a client written in C using libbson from the MongoDB C driver.
According to the spec the first 4 bytes in a BSON document must be interpreted as an int32 with the total number of bytes comprising the document.
js-bson writes this header by taking the serialized string length:
- Optional feature, only enabled for example telecomp.
- Switch to MongoDB js-bson library https://github.com/mongodb/js-bson
- Previous library is broken dptole/js-bson#2
- Since bson.min.js is quite big (~100KiB) it is handled separately,
ie. not embedded into dpf.js
- TODO: add a binary data type to JSValue that fallbacks to Base64
when the protocol is JSON based.
Round-trip encoding/decoding with js-bson works great, but I am having a rough time trying to exchange data with a client written in C using libbson from the MongoDB C driver.
According to the spec the first 4 bytes in a BSON document must be interpreted as an int32 with the total number of bytes comprising the document.
js-bson writes this header by taking the serialized string length:
js-bson/standalone/BSON.js
Line 664 in 77d3b53
The string's length property value is not necessarily equal to the number of bytes comprising the string:
When string length == string byte count libbson correctly deserializes documents, otherwise deserialization fails due to a validation check.
Does this make sense?
The text was updated successfully, but these errors were encountered: