SQL IN like query with Dojo stores

Sometime you need a little more that passing an object to query() of a Dojo store to do a simple compare of a property or two. In those cases you can pass a function that returns a boolean. As an example say you want to return the object where the key is in a list. You can use the following:

var isInList = function(list) {
   return function(object) {
      return list.lastIndexOf(object.id) > -1
var store = new Memory({data: someData})
var results = store.query(isInList(["bar", "Foo"]))

Here's a demo using a FilteringSelect dijit - http://jsfiddle.net/denov/3FQxf/