StackExchange.Redis.Extensions icon indicating copy to clipboard operation
StackExchange.Redis.Extensions copied to clipboard

StackExchangeRedisCacheClient IEnumerable<string> SearchKeys(string pattern) is limited to db 0

Open wiciul opened this issue 11 years ago • 4 comments

var dbKeys = db.Multiplexer.GetServer(endpoint).Keys(pattern: pattern); so it is limited to int database = 0

wiciul avatar Jul 09 '15 14:07 wiciul

You sure about that? looking here the code is using the current istance of the db that is initialized into the constructor.

You should change with the right constructor (if you don't send the database id 0 is the default value)

imperugo avatar Jul 14 '15 08:07 imperugo

The code you linked calls Keys method of RedisServer class which uses "database" parametr so no chance to use "Database" value of "db" object.

I hade to change the code in this way to make it work: var dbKeys = db.Multiplexer.GetServer(endpoint).Keys(database: db.Database, pattern: pattern);

Wthout this change always keys are retrived from database = 0.

rutra0002 avatar Jul 14 '15 12:07 rutra0002

fixed. Soon on nuget

imperugo avatar Aug 28 '15 19:08 imperugo

On nuget now https://www.nuget.org/packages/StackExchange.Redis.Extensions.Core/1.1.13

imperugo avatar Aug 28 '15 20:08 imperugo