Skip to content

Instantly share code, notes, and snippets.

@macalinao
Created July 21, 2014 04:44
Show Gist options
  • Save macalinao/86fb52155570ca414e83 to your computer and use it in GitHub Desktop.
Save macalinao/86fb52155570ca414e83 to your computer and use it in GitHub Desktop.
app.get('/test', function(req, res) {
var fine = true;
fields.filter(function(name) {
if (thiz.restricted.indexOf(name) !== -1) {
fine = false;
return res.error(401, 'Field is restricted.');
}
query.where(name).equals(val);
});
if (!fine) {
return;
}
query.exec(function(err, docs) {
res.json(docs);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment