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

Function PgbsonCountKeys

pg_documentdb_core/src/io/pgbson.c:71–83  ·  view source on GitHub ↗

* PgbsonCountKeys returns the number of keys in a given bson document. */

Source from the content-addressed store, hash-verified

69 * PgbsonCountKeys returns the number of keys in a given bson document.
70 */
71int
72PgbsonCountKeys(const pgbson *bsonDocument)
73{
74 bson_t bson;
75 if (!bson_init_static(&bson, (const uint8_t *) VARDATA_ANY(bsonDocument),
76 VARSIZE_ANY_EXHDR(bsonDocument)))
77 {
78 ereport(ERROR, (errcode(ERRCODE_DOCUMENTDB_BADVALUE),
79 errmsg("invalid input syntax for BSON")));
80 }
81
82 return bson_count_keys(&bson);
83}
84
85
86/*

Callers 2

bson_object_keysFunction · 0.85
InitShardKeyMetadataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected