MCPcopy Create free account
hub / github.com/documentdb/documentdb / PgbsonGetBsonValueAtPath

Function PgbsonGetBsonValueAtPath

pg_documentdb_core/src/io/pgbson.c:692–707  ·  view source on GitHub ↗

* Initializes the iterator from a pgbson at given path and sets the bson_value_t * struct found at the path */

Source from the content-addressed store, hash-verified

690 * struct found at the path
691 */
692void
693PgbsonGetBsonValueAtPath(const pgbson *bson, const char *path, bson_value_t *value)
694{
695 bson_iter_t documentIterator;
696 bson_iter_t iterator;
697 PgbsonInitIterator(bson, &documentIterator);
698
699 if (!bson_iter_find_descendant(&documentIterator, path, &iterator))
700 {
701 value->value_type = BSON_TYPE_EOD;
702 }
703 else
704 {
705 *value = *bson_iter_value(&iterator);
706 }
707}
708
709
710/*

Callers 2

DensifyDocsFromStateFunction · 0.85

Calls 1

PgbsonInitIteratorFunction · 0.85

Tested by

no test coverage detected