MCPcopy Create free account
hub / github.com/F-Stack/f-stack / RM_ZsetScore

Function RM_ZsetScore

app/redis-6.2.6/src/module.c:2732–2737  ·  view source on GitHub ↗

On success retrieve the double score associated at the sorted set element * 'ele' and returns REDISMODULE_OK. Otherwise REDISMODULE_ERR is returned * to signal one of the following conditions: * * * There is no such element 'ele' in the sorted set. * * The key is not a sorted set. * * The key is an open empty key. */

Source from the content-addressed store, hash-verified

2730 * * The key is an open empty key.
2731 */
2732int RM_ZsetScore(RedisModuleKey *key, RedisModuleString *ele, double *score) {
2733 if (key->value == NULL) return REDISMODULE_ERR;
2734 if (key->value->type != OBJ_ZSET) return REDISMODULE_ERR;
2735 if (zsetScore(key->value,ele->ptr,score) == C_ERR) return REDISMODULE_ERR;
2736 return REDISMODULE_OK;
2737}
2738
2739/* --------------------------------------------------------------------------
2740 * ## Key API for Sorted Set iterator

Callers

nothing calls this directly

Calls 1

zsetScoreFunction · 0.85

Tested by

no test coverage detected