Skip to content

I've added support for ember.js model queries out of the box.#5

Open
smebberson wants to merge 1 commit intoenyo:masterfrom
smebberson:master
Open

I've added support for ember.js model queries out of the box.#5
smebberson wants to merge 1 commit intoenyo:masterfrom
smebberson:master

Conversation

@smebberson
Copy link

I've been writing an ember.js application, and wanted to use queries to filter documents on username. I have a collection that stores the same type of document, but I wanted it filtered by the records owner (i.e. username attribute).

I couldn't find support for this in mongo-rest out of the box, so I've added support for it. The following in ember.js:

App.Model.find({'attribute': 'value'});

Produces the following:

GET /api/1.0/clients?attribute=value HTTP/1.1
Accept: application/json, text/javascript, */*; q=0.01

The code I've added will support these ember.js find queries, out of the box.

@smebberson
Copy link
Author

In thinking this through, I think it should check the model and only use query string variables with the same name as those on the model. That way other information can be passed through Ember.Model.find without it being included as a mongoose filter parameter?

If you agree, I'll add to my pull-request.

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

Successfully merging this pull request may close these issues.

1 participant