Created
July 21, 2014 04:44
-
-
Save macalinao/86fb52155570ca414e83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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