SYNOPSIS
#include <bson.h> #define BSON_ITER_HOLDS_UTF8(iter) \ (bson_iter_type ((iter)) == BSON_TYPE_UTF8) const char * bson_iter_utf8 (const bson_iter_t *iter, uint32_t *length);
DESCRIPTION
The bson_iter_utf8() function shall retrieve the contents of a BSON_TYPE_UTF8 element currently observed by iter.
It is invalid to call this function while ovserving an element other than BSON_TYPE_UTF8.
RETURN VALUE
A UTF-8 encoded string that has not been modified or freed.
It is suggested that the caller validate the content is valid UTF-8 before using this in other places. That can be done by calling bson_utf8_validate() or validating the underlying bson_t before iterating it.
ERRORS
No errors are defined.
AUTHORS
This page was written by MongoDB, Inc.