Closed ufownl closed 5 years ago
Hm. I think a proper way would be to check if passed id is indeed bson oid, or just a string and convert accordingly.
Perhaps modifying the cbson.oid constructor so that it can construct an oid from another oid object is a better way. In addition, we can implement cbson.oid through a fixed-length buffer to avoid heap-alloc.
The document for this method is here.