SYNOPSIS

#include <bson.h>

bool
bson_iter_find (bson_iter_t *iter,
                const char  *key);

bool
bson_iter_find_case (bson_iter_t *iter,
                     const char  *key);

bool
bson_iter_find_descendant (bson_iter_t *iter,
                           const char  *dotkey,
                           bson_iter_t *descendant);

DESCRIPTION

The bson_iter_find() function shall advance iter to the element named key or exhaust all elements of iter. If iter is exhausted, FALSE is returned and iter should be considered invalid.

The bson_iter_find_case() function shall advance iter to the element named key while ignoring case-sensitivity or exhaust all element of iter. If iter is exhausted, FALSE is returned and iter should be considered invalid.

The bson_iter_find_descendant() function shall follow standard MongoDB dot notation to recurse into subdocuments. descendant will be initialized and advanced to the descendant. If FALSE is returned, both iter and descendant should be considered invalid.

RETURN VALUE

TRUE is returned if the requested key was found. If not, iter was exhausted and should now be considered invalid.

ERRORS

FALSE is returned if the requested key could not be found.

SEE ALSO

AUTHORS

This page was written by MongoDB, Inc.