Answer the question
In order to leave comments, you need to log in
How to get the desired value of the desired property in node?
This is how I can get all the contents of the Data
Data.find({}, function (err, ds) {
console.log(ds);
})
{
"_id":"55696b8c00ed0cbc25cb9161",
"name":"1234",
"description":"4rgsdfgdsfg fgsdfgdsf",
"__v":0
}
dataschema.methods.goodName = function () {
console.log(this.get('name'))
}
})
Answer the question
In order to leave comments, you need to log in
This is called projection, i.e. you can specify which fields to return:
Data.find( { }, { name: 1, fieldName: 1, id: 0 } , function(err, arr) { ... });
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question