Hai guys can you please anyone tellme, I have number of users in my mongodb, i need to get title in Array of that users to frontend. can anyone please tellme where the error occurs and what i need to put.
thanks in advance.
my HTML component
<label> <mat-card class="example-card" *ngFor="let articles of userDetails">{{articles.title}} </label>
usercontroller.js
//Getting title in Users userRouter.post('/getWeb', (req, res) => { Collections.user.find({}, {"article":1}, function (err, result) { if (err) return res.status(500).send("There was a problem finding the user"); if (result) { return res.status(200).send(result); } else { return res.status(500).send("User Not Found with Details: " + JSON.stringify(user)); } }); });
my mongodb structure is:
article:Array 0:Object title:"hello"
Hai guys can you please anyone tellme, I have number of users in my mongodb, i need to get title in Array of that users to frontend. can anyone please tellme where the error occurs and what i need to put. thanks in advance.