Closed cleverca22 closed 10 years ago
Interesting, could you show a use case please?
https://gist.github.com/cleverca22/c4673cb45b827190dee9
with this, you can serialize an ObjectId in a Mongoose document and store it as a 12 byte bytes field in protobuf rather then a 24 byte hex string
it can likely also be used on plain mongodb with the same idea
if an object of protobuf type CPPTYPE_STRING contains a .toProtobuf method that returns a Buffer
use that return value for the serialized stream