express/koa middleware to parse bson body.
var Koa = ;var bodyBson = ;var app = ;app;app;
var express =var bodyBson =var app =// parse application/bsonappapp
var bodyBson =
The bodyBson function is a factory to create middleware.
The middleware will populate the
property with the parsed body when the Content-Type request header matches the type option(default to
application/bson), nothing would be modified if the Content-Type was not matched, or an error occurred.
The default bson instance used by bodyBson. It's exported for convenience.
Controls the bson instance to deserialize the body.
One method is required for the instance:
Defaults to instance created by
Controls the maximum request body size. If this is a number, then the value specifies the number of bytes; if it is a
string, the value is passed to the
bytes library for parsing. Defaults to '10mb'.
Controls the matching Content-Type headers, can pass a string or an array of strings. Defaults to
Controls whether to generate
request.rawBody to represent raw buffer received.
request.rawBody will only be generated if
request.rawBody should be generated. Defaults to