MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / RM_ZsetScore

Function RM_ZsetScore

src/module.cpp:2820–2825  ·  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

2818 * * The key is an open empty key.
2819 */
2820int RM_ZsetScore(RedisModuleKey *key, RedisModuleString *ele, double *score) {
2821 if (key->value == NULL) return REDISMODULE_ERR;
2822 if (key->value->type != OBJ_ZSET) return REDISMODULE_ERR;
2823 if (zsetScore(key->value,szFromObj(ele),score) == C_ERR) return REDISMODULE_ERR;
2824 return REDISMODULE_OK;
2825}
2826
2827/* --------------------------------------------------------------------------
2828 * ## Key API for Sorted Set iterator

Callers

nothing calls this directly

Calls 2

zsetScoreFunction · 0.85
szFromObjFunction · 0.85

Tested by

no test coverage detected