persvr / rql

Resource Query Language
http://www.persvr.org/
267 stars 49 forks source link

Duplicate Results in js-array.query #41

Open dmachi opened 10 years ago

dmachi commented 10 years ago

When I use the js-array query, for some reason I'm getting two results even when the initial dataset is only one item:

var ArrayQuery=require("rql/js-array").query var data = [{"id":"1a473b86-1bc3-4579-b990-a06068c15ac1","state":"available","public":true,"type":"toolbox","name":"TestTool1","ownerId":"dmachi","description":""}];

console.log(ArrayQuery("or(and(eq(state,available),eq(public,true)),eq(ownerId,dmachi))",{},data));

This should return exactly one item, but instead returns the correct item twice. Am I doing something wrong here or is this a bug?