You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm trying to do a scan, limited to hash types, but still getting back all entries of all types. Basically, I'm trying to do a scan like redis-cli scan 0 TYPE hash, but in Lettuce. The redis-cli approach does work as expected (only returns hash keys).
Am I setting up CommandArgs incorrectly?
RedisCommands<String, String> rc = redisConnection.sync();
var scanArgs = new ScanArgs();
RedisCodec<String, String> codec = StringCodec.UTF8;
var cmdArgs = new CommandArgs<>(codec).add(0).add("TYPE").add("hash"); // Is my problem here?
scanArgs.build(cmdArgs);
var scanResult = rc.scan(scanArgs);
The output of cmdArgs.toCommandString() is 0 TYPE hash, which looks correct.
scanResult.getKeys() does contain keys, but for both hash and set. I'm only expecting hash.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I'm trying to do a scan, limited to hash types, but still getting back all entries of all types. Basically, I'm trying to do a scan like
redis-cli scan 0 TYPE hash
, but in Lettuce. The redis-cli approach does work as expected (only returns hash keys).Am I setting up CommandArgs incorrectly?
The output of
cmdArgs.toCommandString()
is0 TYPE hash
, which looks correct.scanResult.getKeys()
does contain keys, but for both hash and set. I'm only expecting hash.Thanks for any guidance.
Beta Was this translation helpful? Give feedback.
All reactions