Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find request returns all entries whatever the params #114

Closed
arkabase opened this issue Apr 13, 2021 · 1 comment
Closed

Find request returns all entries whatever the params #114

arkabase opened this issue Apr 13, 2021 · 1 comment

Comments

@arkabase
Copy link

Steps to reproduce

a NEDB data collection with 2 entries, different type property :

{"_id":"<cardid>","type":"admin",...}
{"_id":"<cardid>","type":"customer",...}

a cards feathers service

a CURL query :

curl -H 'Content-Type: application/json' -X GET http://<host>/cards -d '{"type":"customer"}'

returns all the collection entries instead of filtering with params

Expected behavior

{"total":1,"limit":10,"skip":0,"data":[{"_id":"<cardid>","type":"customer",...}]}

Actual behavior

{"total":2,"limit":10,"skip":0,"data":[{"_id":"<cardid>","type":"admin",...},{"_id":"<cardid>","type":"customer",...}]}

System configuration

Operating System: Debian 10 Buster

NodeJS: 14.16.0

feathers-nedb: 5.1.0

nedb: 1.8.0

@daffl
Copy link
Member

daffl commented Apr 13, 2021

As documented in the Querying API you should use a query string, for HTTP GET requests not a JSON body:

curl -H 'Content-Type: application/json' -X GET http://<host>/cards?type=customer

@daffl daffl closed this as completed Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants