Reputation: 259
I've got a problem when finding from our mongoDB.
Imagine having a mongodb like this: {name: John}, {name: John}, {name: Otto} {name: Louise}, {name: Sarah}, {name: Louise}
our web-server.js is like:
app.get('/names/*', function(req, res){
names.find({}, function(err, names){
res.json(names);
}); });
i get John, John, Otto, Louise, Sarah, Louise in result. Is there a way i can get only John, Otto, Louise and Sarah?
Upvotes: 1
Views: 66
Reputation: 144
You should look at using a filter in the HTML-page. Like this:
{Names | unique}
The documents can be viewed here:
http://docs.angularjs.org/api/ng/filter/filter
Upvotes: 1