{"action":"created","issue":{"url":"https://api.github.com/repos/siddontang/ledisdb/issues/138","labels_url":"https://api.github.com/repos/siddontang/ledisdb/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/siddontang/ledisdb/issues/138/comments","events_url":"https://api.github.com/repos/siddontang/ledisdb/issues/138/events","html_url":"https://github.com/siddontang/ledisdb/issues/138","id":59427159,"number":138,"title":"refactor scan command","user":{"login":"siddontang","id":1080370,"avatar_url":"https://avatars.githubusercontent.com/u/1080370?v=3","gravatar_id":"","url":"https://api.github.com/users/siddontang","html_url":"https://github.com/siddontang","followers_url":"https://api.github.com/users/siddontang/followers","following_url":"https://api.github.com/users/siddontang/following{/other_user}","gists_url":"https://api.github.com/users/siddontang/gists{/gist_id}","starred_url":"https://api.github.com/users/siddontang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siddontang/subscriptions","organizations_url":"https://api.github.com/users/siddontang/orgs","repos_url":"https://api.github.com/users/siddontang/repos","events_url":"https://api.github.com/users/siddontang/events{/privacy}","received_events_url":"https://api.github.com/users/siddontang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-03-02T00:54:55Z","updated_at":"2015-03-04T15:36:45Z","closed_at":null,"body":"Now \"scan\" commands are very redundant and complicate, see #137. It is time to refactor them. \r\n\r\nFor compatibility, I may not remove old `XSCAN`, `XLSCAN`, etc..., so maybe another API is better, like this:\r\n\r\n```\r\nXKEYSCAN type cursor [MATCH match] [COUNT count]\r\n```\r\n\r\n\"type\" is kv, list, hash, set, and zset. This API likes redis [SCAN](http://redis.io/commands/scan), to iterates keys, for different data type. \r\n\r\nBut if we don't care compatibility, we may use `XSCAN` instead, @pkieltyka. \r\n\r\n```\r\nXHSCAN key cursor [MATCH match] [COUNT count]\r\n```\r\n\r\nXHSCAN likes redis HSCAN to iterates hash field and values. \r\n\r\n```\r\nXSSCAN key cursor [MATCH match] [COUNT count]\r\n```\r\n\r\nXSSCAN likes redis SSCAN to iterates set memebers.\r\n\r\n```\r\nXZSCAN key cursor [MATCH match] [COUNT count]\r\n```\r\n\r\nXZSCAN likes redis ZSCAN to iterates zset element and score."},"comment":{"url":"https://api.github.com/repos/siddontang/ledisdb/issues/comments/77180187","html_url":"https://github.com/siddontang/ledisdb/issues/138#issuecomment-77180187","issue_url":"https://api.github.com/repos/siddontang/ledisdb/issues/138","id":77180187,"user":{"login":"siddontang","id":1080370,"avatar_url":"https://avatars.githubusercontent.com/u/1080370?v=3","gravatar_id":"","url":"https://api.github.com/users/siddontang","html_url":"https://github.com/siddontang","followers_url":"https://api.github.com/users/siddontang/followers","following_url":"https://api.github.com/users/siddontang/following{/other_user}","gists_url":"https://api.github.com/users/siddontang/gists{/gist_id}","starred_url":"https://api.github.com/users/siddontang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siddontang/subscriptions","organizations_url":"https://api.github.com/users/siddontang/orgs","repos_url":"https://api.github.com/users/siddontang/repos","events_url":"https://api.github.com/users/siddontang/events{/privacy}","received_events_url":"https://api.github.com/users/siddontang/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T15:36:45Z","updated_at":"2015-03-04T15:36:45Z","body":"@kouhate , I will add reverse scan later, but you must know below:\r\n\r\n+ reverse scan is slower than forward, unless leveldb or rocksdb improves it.\r\n+ migrating a huge hash data (with many fields and values) is very terrible in xcodis when resharding. We must dump this huge data first, then transfer into another server and load it, it may take huge memory, cost many time and block other write operations for a long time. \r\n\r\nBtw, I think ZREVRANGE* may be more convenient than XZSCAN DESC."}}