Permalink
Browse files

Commit for mysql findKeys

  • Loading branch information...
1 parent d0c4117 commit 76dc504b9fe0b9a49cfe882b68a2f6afdf0a401e @spcsser spcsser committed Feb 17, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 mysql_db.js
View
@@ -104,12 +104,13 @@ exports.database.prototype.findKeys = function (key, notKey, callback)
var query="SELECT `key` FROM `store` WHERE `key` LIKE ?"
, params=[]
;
- //desired keys are %key:%, e.g. pad:%
+
+ //desired keys are key, e.g. pad:%
key=key.replace(/\*/g,'%');
params.push(key);
if(notKey!=null && notKey != undefined){
- //not desired keys are notKey:%, e.g. %:%:%
+ //not desired keys are notKey, e.g. %:%:%
notKey=notKey.replace(/\*/g,'%');
query+=" AND `key` NOT LIKE ?"
params.push(notKey);

0 comments on commit 76dc504

Please sign in to comment.