Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create LIKE operator search in Redis cache using nodejs?

I have a question, is it possible to create a LIKE operator search in Redis? Similar to relational (mysql/oracle) database.

I have complex json:

   {"_id" : ObjectId("581c8b8854fdcd1ff8c944e0"),
"Objectcode" : "xxxxx",
"Objecttype" : "xxxx",
"docid" : "581c8b8554fdcd1ff8c93d10",
"description" : "Tags based search .... ",
"metaTags" : [ 
    "tag1", 
    "tag2", 
    "tag3", 
    "tag5", 
    "tag6", 
    "tag7", 
    "tag8", 
    "tag9", 
    "tag10"
],
"__v" : 0

}

and i want to search on array of metaTags how can i do it?

Thanks

like image 933
ALAxmAnA Avatar asked Feb 20 '26 12:02

ALAxmAnA


1 Answers

You can use MATCH commands to search data.

Eg: scan 0 MATCH *11*

Refer: http://redis.io/commands/scan

like image 163
Chandana Kumara Avatar answered Feb 23 '26 03:02

Chandana Kumara



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!