florianholzapfel/express-restify-mongoose — pull request #2 by nothingbuttumbleweed (2013-06-15 17:17:10+00:00)
Title: Querystring parameters that doesn't belong to the model

When dealing with API calls sometimes we want to let the browser decide whether to respond a request with a cached response or make a new request. Some other times we want to explicit the disable cache parameter. This parameter is added to the querystring like "_dc=1300243558614".

There is a problem when the restify module receives parameters like these. When the query of the mongoose model is built restify will treat this parameter as a restriction but it is not a restriction. For that reason I added a condition on the buildQuery method that adds the parameter to the query only if it's a property of the schema.