* ComputeShardKeyHashForQuery is the same as ComputeShardKeyHashForQueryValue but * with a pgbson instead. */
| 577 | * with a pgbson instead. |
| 578 | */ |
| 579 | bool |
| 580 | ComputeShardKeyHashForQuery(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 | /* |
no test coverage detected