davidgtonge / backbone_query

A lightweight query api for Backbone Collections
MIT License
378 stars 29 forks source link

dynamic queries not working? #15

Closed ghost closed 11 years ago

ghost commented 11 years ago

Hey,

I'm trying to create a dynamic query, but it just doesn't seem to want to work, even though the query I'm generating works when I put it in statically. No errors are being thrown... Everything works except the dynamic query.

query = {};

for(i in selected) { if(selected.hasOwnProperty(i)) { var terms;

    if(selected[i].indexOf(',') >= 0) {
        terms = {$all: selected[i].split(',')};
    } else {
        terms = selected[i];
    }
}

query[i] = terms;

}

result = this.collection.query(query); console.log(result);

davidgtonge commented 11 years ago

Hi, please can you re-open this issue if you are still having it. Thanks