Getting size of deserialized bson document #2131
Labels
kind: question
state: stale
the issue has not been updated in a while and will be closed automatically soon unless it is updated
Sometimes bson documents can be combined one after another (for example when asynchronously read from socket) and in this case they must be readed separately. First document can be readed as:
But now is a problem: how to read second document? Because we don't know haw match bytes already read. Of cause we can read first 4 bytes in body and get size of bson manually, but, I think, this will be a usefull feature, if function
from_bson
also return capacity of readed bytes (for example as 4-th argument). In this case reading combined bson documents will be match simpler:What do you think about this?
Which version of the library did you use?
develop
branchThe text was updated successfully, but these errors were encountered: