Hi, I'm developing a MEAN app. I'm wondering if I made a good choice for
this:
I deleted my mongodb collection "presidents" and I exposed this express
resource in this way
router.get('/', function(req,res) {
var presidents=["President","Vice-President","Grand President",...];
var query = regexp.startsWith(req.query.q)
var ret= []
presidents.forEach(function (el) {
if (query.test(el)) ret.push(el)
});
return res.json(ret)
});
So no more extra mongodb collection for this. Obiouvsly the presidents in
my case can't change, I use this array just for an autocomplete text field.
Do you think it's a good pratice make those 'immutable' collection like
this?
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/dbbe17ac-7e2f-4ec6-8a9f-d3d5e6f619b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.