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

Function bson_dollar_unwind

pg_documentdb/src/aggregation/bson_unwind.c:141–153  ·  view source on GitHub ↗

* bson_dollar_unwind takes: * 1) a bson document * 2) a dot notation field path to the purported array * 3) an optional text for an index field in the output * 4) a boolean indicating whether to preserve null and empty arrays */

Source from the content-addressed store, hash-verified

139 * 4) a boolean indicating whether to preserve null and empty arrays
140 */
141Datum
142bson_dollar_unwind(PG_FUNCTION_ARGS)
143{
144 char *indexFieldName = NULL;
145 bool preserveNullAndEmpty = false;
146
147 TupleDesc descriptor;
148 Tuplestorestate *tupleStore = SetupBsonTuplestore(fcinfo, &descriptor);
149
150 return BsonUnwindArray(fcinfo, tupleStore, &descriptor, text_to_cstring(
151 PG_GETARG_TEXT_PP(1)), indexFieldName,
152 preserveNullAndEmpty);
153}
154
155
156/*

Callers

nothing calls this directly

Calls 2

SetupBsonTuplestoreFunction · 0.85
BsonUnwindArrayFunction · 0.85

Tested by

no test coverage detected