* 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. */
| 2240 | * on complement sets (e.g. NOT operators) from the index. |
| 2241 | */ |
| 2242 | Datum |
| 2243 | GenerateRootExistsTerm(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 | /* |
no test coverage detected