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

Function ComputeShardKeyHashForQuery

pg_documentdb/src/sharding/sharding.c:579–593  ·  view source on GitHub ↗

* ComputeShardKeyHashForQuery is the same as ComputeShardKeyHashForQueryValue but * with a pgbson instead. */

Source from the content-addressed store, hash-verified

577 * with a pgbson instead.
578 */
579bool
580ComputeShardKeyHashForQuery(pgbson *shardKey, uint64_t collectionId, pgbson *query,
581 int64 *shardKeyHash, bool *isShardKeyValueCollationAware)
582{
583 if (shardKey == NULL)
584 {
585 *shardKeyHash = collectionId;
586 *isShardKeyValueCollationAware = false;
587 return true;
588 }
589
590 bson_value_t queryValue = ConvertPgbsonToBsonValue(query);
591 return ComputeShardKeyHashForQueryValue(shardKey, collectionId, &queryValue,
592 shardKeyHash, isShardKeyValueCollationAware);
593}
594
595
596/*

Callers 1

ProcessDeletionFunction · 0.85

Calls 2

ConvertPgbsonToBsonValueFunction · 0.85

Tested by

no test coverage detected