0

async function getCourses() {

return await Course.find({author:'NARESH RAMINI'});

}

async function run(){

const result=await getCourses();
console.log(result);
   

}

run();

Below is the Terminal's output for the above code for retrieving documents from mongodb

Terminal populates with additional information

What can be done to make the terminal show only or populate only queried documents from mongoDB?

jit jade
  • 3
  • 4
  • Does this answer your question? [How to select a single field for all documents in a MongoDB collection?](https://stackoverflow.com/questions/25589113/how-to-select-a-single-field-for-all-documents-in-a-mongodb-collection) – varman May 24 '21 at 16:52
  • @varman The link you've provided has a different question. please check the screenshot attached to my question. Problem is terminal populates with unnecessary information, which only suppose to show queried documents. There should be a setting to make terminal to show only result of documents. – jit jade May 24 '21 at 16:57
  • Does this help you https://stackoverflow.com/a/57209253/7975771 – varman May 24 '21 at 17:00
  • 1
    @varman Yes it solves the issue. Thank you very much! – jit jade May 24 '21 at 17:09

0 Answers0