user1354934
user1354934

Reputation: 8841

Redis count items in a geo index

I added some records using GEOADD, but how can I get a count of how many items?

I made one called cities and added a bunch of city lat/lng, but I am curious how I can get a count of how many there are?

Upvotes: 0

Views: 156

Answers (1)

for_stack
for_stack

Reputation: 22926

The geo index is, in fact, a sorted set. So you can use ZCARD to get the size of index.

Upvotes: 1

Related Questions