0

I am trying to recover a table. the console.log(docs) works but I can't output the array to a variable. I want to retrieve the table stored in docs

 var Datastore = require('nedb'),
    db= new Datastore ({filename: "dataCalendar.db", autoload: true});
        db.find({},(function (err, docs) {                           
          console.log("docs", docs);
          test = docs;
        }
        ))

I tried to output it in an external variable but it does not work indefinite variable

  • 1
    Duplicate of [How do I return the response from an asynchronous call?](https://stackoverflow.com/questions/14220321/how-do-i-return-the-response-from-an-asynchronous-call) – Samathingamajig Jan 20 '23 at 17:58

0 Answers0