Query Data Asynchronous Problem with mongoose

  node.js, question

I need to expose the results of the find () query to other pages, but the find () query operation is asynchronous, how to implement it?

var settings = require ("./settings");
 var mongoose = require('mongoose');
 var db = mongoose.connection;
 var Schema = mongoose.Schema;
 Mongoose.connect('mongodb://' plus settings.host plus'/'plus settings.db);
 var articleSchema = new Schema({
 title    : String,
 author   : Array,
 aclTitle : Array,
 creation : Array,
 brife    : Array
 });
 var articleModel = mongoose.model('articles',articleSchema);
 var articleEntity = new articleModel({});
 db.on('error',function(){
 Log ("connection error")
 });
 db.once('open',function () {
 Log ("connection succeeded!"  )
 });
 articleModel.find(function(e,d) {
 module.exports = d;  //I want to exports the query results here, and another page require to come in.
 })//But because it is asynchronous, it is written in callback inside, and other pages require to enter empty objects.
 //Write outside the callback, then you cannot get the query result.

Mongoose has two calling methods, one is callbacl and the other is promise.

For example, define a getAll
1.callback

a.js
 Callback form, outside
 function getAll(cb){
 xxModel.find({},cb);
 bracket
 module.exports.getAll=getAll;
 
 b.js
 var a=require('a');
 a.getAll(function(err,result){
 console.log(result);
 })

2.promise

a.js
 function personTest() {
 return Person.find({}).exec();
 bracket
 
 b.js
 var a=requre('a');
 a.getAll().then(fnction(rseult){
 console.log(result);
 }).catch(function(err){
 console.log(err);
 })