You can use multi query approach, as described in recently updated tutorial.
Basically, you will create iterator for each element of IN clause and join (union) the result, as follow:
var keys = [];
var multiQuery = function(sec_keys, pri_keys) {
var advance = [];
var cmp = ydn.db.cmp(pri_keys[0], pri_keys[1]);
if (cmp == 1) { // pri_keys[0] > pri_keys[1]
if (keys[keys.length - 1] != pri_keys[1]) {
keys.push(pri_keys[1]);
}
advance[1] = true; // advance iter_1 on step
} else if (cmp == -1) { // pri_keys[0] < pri_keys[1]
if (keys[keys.length - 1] != pri_keys[0]) {
keys.push(pri_keys[0]);
}
advance[1] = true; // advance iter_1 on step
} else { // pri_keys[0] == pri_keys[1]
if (keys[keys.length - 1] != pri_keys[0]) {
keys.push(pri_keys[0]);
}
advance[0] = true; // advance iter_0 on step
advance[1] = true; // advance iter_1 on step
}
if (keys.length >= 10) {
return [];
} else {
return advance;
}
};
Then use scan
method:
db.scan(multiQuery, [iterators...]).done(function() {
db.values('article', keys).done(function(values) {
console.log(keys, values);
})
});