How get the "score" value when I put an element in a sortedSet
-
For example suppose I put the element in a sorted set in this way:
db.sortedSetAdd(set, Date.now(), data.name, function(err) {
});Now I want to get for every element the value of "Date.now()". I see the API but I don't find the solution. Anyone can help me?
-
Look at the methods
sortedSetScore
&sortedSetScores
Ie
db.sortedSetScore(set, data.name, calback);
-
@baris I think these methods " set" the value but I need to "get" value!
-
No they return the score of the value.
db.sortedSetScore(set, data.name, function(err, score) { console.log(score); });
Suggested Topics
Copyright © 2018 NodeBB | Contributors