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

Function IsPgbsonEmptyDocument

pg_documentdb_core/include/io/pgbson.h:130–134  ·  view source on GitHub ↗

* Validate if the pgbson is an empty document. * Note that the bson spec (https://bsonspec.org/spec.html) implies that an array has * 4 bytes for the array length, followed by a list of [ 1 byte type code, path, value] * This implies that a non empty array has 4 bytes of length, 1 byte of type code * (for the first element), and at least 1 byte for the index path which is 6 bytes at least. */

Source from the content-addressed store, hash-verified

128 * (for the first element), and at least 1 byte for the index path which is 6 bytes at least.
129 */
130inline static bool
131IsPgbsonEmptyDocument(const pgbson *value)
132{
133 return value != NULL && VARSIZE_ANY_EXHDR(value) < 6;
134}
135
136
137/*

Calls

no outgoing calls

Tested by

no test coverage detected