Skip to content
This repository has been archived by the owner on Jul 20, 2019. It is now read-only.

Update rest.js #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update rest.js #4

wants to merge 1 commit into from

Conversation

rjrahul
Copy link

@rjrahul rjrahul commented Oct 8, 2014

Changed to fix broken field select.

Changed to fix broken field select.
@rjrahul
Copy link
Author

rjrahul commented Oct 8, 2014

Tried performing a field select using rest API but it did not work. It always resulted in an error saying cannot forEach on null. After debugging i found the issue was that docs object was being returned as null from MongoClient. To fix this I made changes to rest.js to create options.fields as an array. I have submitted the change and a pull request for this too in branch rjrahul/crest.

Following is the query i used

http://127.0.0.1:3500/mydb/testData?query={%22name%22:%22rahul%22}&fields=name,gender

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant