jaystack / odata-v4-mongodb

This server component lets you process OData requests over a MongoDB database
30 stars 22 forks source link

invalid createQuery result if used or, contains and eq #5

Closed andriy-f closed 7 years ago

andriy-f commented 7 years ago

Hi,

function createQuery produces invalid result if supplied with following query: filter=contains(Name,'be') or Name eq 'Produce'

Input: http://odata-v4-demo.jaystack.net/api/Categories?$filter=contains(Name,'be') or Name eq 'Produce'

Output: { "@odata.context": "http://odata-v4-demo.jaystack.net/api/$metadata#Categories", "value": [ { "@odata.id": "http://odata-v4-demo.jaystack.net/api/Categories('578f2baa12eaebabec4af289')", "@odata.editLink": "http://odata-v4-demo.jaystack.net/api/Categories('578f2baa12eaebabec4af289')", "_id": "578f2baa12eaebabec4af289", "Description": "Soft drinks", "Name": "Beverages" } ] }

i.e. one element is missing ('Produce' category)

andriy-f commented 7 years ago

O I see someone fixed it by some recent commit (it's in sources but not published yet. Waiting for release!

andriy-f commented 7 years ago

It was fixed by this PR https://github.com/jaystack/odata-v4-mongodb/pull/4. It's not on npm yet

aaghevli commented 7 years ago

I believe this has been merged and available in version 1.11. Can you confirm?

andriy-f commented 7 years ago

yes. it's fixed. Thanks!

andriy-f commented 7 years ago

I guess I should wait until PR is merged

aaghevli commented 7 years ago

The PR #4 is merged and the latest npm version updated as far as I know.

andriy-f commented 7 years ago

And this PR https://github.com/jaystack/odata-v4-mongodb/pull/7 ?

aaghevli commented 7 years ago

Huh strange. I think someone updated independent of that PR #7 so we should be good to go.

https://github.com/jaystack/odata-v4-mongodb/blob/master/package.json#L3

andriy-f commented 7 years ago

Closing then. Thanks