ueberDB.findKeys(key, notkey, callback) provides functionality to retrieve a list of key values.
key defines which data we want to find, excluding data that matches the param
notKey (can be null).
Consider the following entries as example:
test:id1 test:id1:chat:id2 chat:id3:test:id4
We want to find all unique entries for the key part
test like in
test:test1 but not the other two entries.
We would issue the following search:
ueberDB.findKeys("test:*","*:*:*");. The first params says we're looking for entries that match test: with anything that follows, but not entries that have multiple colons to exclude entries like
Depending on the database type, there are currently two strategies too perform queries.
For document based dbms like mongodb, dirty or couch we use a regex and tranform the params into regex.
*:*:* will be transformed into a regular expression:
For relational dbms like mysql or postgres we use the like operator. The parameters
*:*:* translate to this where condition:
store.key LIKE 'test:%' AND store.key NOT LIKE '%:%:%'.