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

Function IndexSpecIsOrderedIndex

pg_documentdb/src/metadata/index.c:2417–2437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2415
2416
2417bool
2418IndexSpecIsOrderedIndex(const IndexSpec *indexSpec)
2419{
2420 if (indexSpec->indexOptions == NULL)
2421 {
2422 return false;
2423 }
2424
2425 bson_iter_t iter;
2426 PgbsonInitIterator(indexSpec->indexOptions, &iter);
2427 while (bson_iter_next(&iter))
2428 {
2429 const char *key = bson_iter_key(&iter);
2430 if (IsOptionsKeyOrderedIndex(key))
2431 {
2432 return BsonValueAsBool(bson_iter_value(&iter));
2433 }
2434 }
2435
2436 return false;
2437}
2438
2439
2440/*

Calls 3

PgbsonInitIteratorFunction · 0.85
IsOptionsKeyOrderedIndexFunction · 0.85
BsonValueAsBoolFunction · 0.85

Tested by

no test coverage detected