Open richardschneider opened 9 years ago
https://www.npmjs.com/package/bson looks like the package to use.
And there's a new kid on the block http://ubjson.org/
There is no official content-type
for BSON, but most people are expecting application/bson
or application/xxx+bson
.
There doesn't appear to be any content negotiation middleware available in express. The only thing I've seen is at the route layer (https://github.com/cleishm/express-negotiate) which violates separation of concern.
Maybe adding a express-mung
is the way to go.
To convert our application/json
response to application/bson
the HTTP header Accept
or query parameter ?format
could be used.
Would BSON instead of JSON be a more compact representation for #6?