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

Function GenerateRootExistsTerm

pg_documentdb/src/opclass/gin_index_term.c:2242–2253  ·  view source on GitHub ↗

* This is the root term that all documents get when the indexed path exists. * We pick a term that points to a path that is illegal ('') * and give it to all terms. This allows us to answer questions * on complement sets (e.g. NOT operators) from the index. */

Source from the content-addressed store, hash-verified

2240 * on complement sets (e.g. NOT operators) from the index.
2241 */
2242Datum
2243GenerateRootExistsTerm(const IndexTermCreateMetadata *termData)
2244{
2245 pgbsonelement element = { 0 };
2246 element.path = "";
2247 element.pathLength = 0;
2248 element.bsonValue.value_type = BSON_TYPE_BOOL;
2249 element.bsonValue.value.v_bool = true;
2250 IndexTermMetadata termMetadata = IndexTermIsMetadata;
2251 return PointerGetDatum(SerializeBsonIndexTermCore(&element, termData,
2252 termMetadata).indexTermVal);
2253}
2254
2255
2256/*

Callers 8

GenerateTermsFunction · 0.85
GenerateNegationTermsFunction · 0.85
AddNullArrayOpTermsFunction · 0.85
GinBsonExtractQueryNotInFunction · 0.85

Calls 1

Tested by

no test coverage detected