we need a validation method for bsoncxx.
It should probably look something like:
std::optional<document::view> document::validate(trivial_buffer buf, validator& v);
Then validator might looks like:
struct validator {
bool validate_utf8;
bool validate_dollar_keys;
bool validate_dot_keys;
bool validate_utf8_allow_null;
std::uint8_t* error;
}
on success we return an engaged document::view.
On error we return an unengaged view, setting the error field in the validator