.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BSON_VALIDATE" "3" "Apr 02, 2024" "1.26.2" "libbson" .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX bool bson_validate (const bson_t *bson, bson_validate_flags_t flags, size_t *offset); .EE .UNINDENT .UNINDENT .SH PARAMETERS .INDENT 0.0 .IP \(bu 2 \fBbson\fP: A \fI\%bson_t\fP\&. .IP \(bu 2 \fBflags\fP: A bitwise\-or of all desired \fI\%bson_validate_flags_t\fP\&. .IP \(bu 2 \fBoffset\fP: A location for the offset within \fBbson\fP where the error occurred. .UNINDENT .SH DESCRIPTION .sp Validates a BSON document by walking through the document and inspecting the keys and values for valid content. .sp You can modify how the validation occurs through the use of the \fBflags\fP parameter, see \fI\%bson_validate_with_error()\fP for details. .SH RETURNS .sp Returns true if \fBbson\fP is valid; otherwise false and \fBoffset\fP is set to the byte offset where the error was detected. .sp \fBSEE ALSO:\fP .INDENT 0.0 .INDENT 3.5 .nf \fI\%bson_validate_with_error()\fP\&. .fi .sp .nf \fI\%bson_visitor_t\fP can be used for custom validation, \fI\%Example Custom Validation\fP\&. .fi .sp .UNINDENT .UNINDENT .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .