carta
bson_validate(3)

bson_validate3

Parameters

•

bson: A bson_t.

•

flags: A bitwise-or of all desired bson_validate_flags_t.

•

offset: Optional location where the error offset will be written.

Overview

Validates a BSON document by walking through the document and inspecting the keys and values for valid content.

You can modify how the validation occurs through the use of the flags parameter, see bson_validate_flags_t for details.

Returns

If bson passes the requested validations, returns true. Otherwise, returns false and if offset is non-NULL it will be written with the byte offset in the document where an error was detected.

To get more information about the specific validation failure, use bson_validate_with_error_and_offset() instead.

SEE ALSO:

bson_validate_with_error(), bson_validate_with_error_and_offset().
bson_visitor_t can be used for custom validation, Example Custom Validation.

History

  • Debian 13 (Trixie): the text shown here
  • Debian 12 (Bookworm)
  • Debian 11 (Bullseye)
  • Debian 10 (Buster)
  • Debian 9 (Stretch)

Author

MongoDB, Inc

From libbson-doc 1.30.4-1+deb13u3 in Debian 13 (Trixie). Parsed by carta from the page's man source.