code: function createMongoosePromise(resolver) {
      var promise
  
      // mongoose 5 and up
      if (parseInt(mongoose.version) >= 5) {
        promise = new mongoose.Promise(resolver)
      }
      // mongoose 4.1 and up
      else if (mongoose.Promise.ES6) {
        promise = new mongoose.Promise.ES6(resolver)
      }
      // backward compatibility
      else {
        promise = new mongoose.Promise
        resolver(promise.resolve.bind(promise, null), promise.reject.bind(promise))
      }
  
      return promise
    }
docs: Creates a Mongoose promise.