title: MongoDB "TypeError: cb is not a function"
body: <p>When I call Activity interface to find all activites, I kept getting error of "TypeError: cb is not a function".</p>
  
  <p>Development environment:</p>
  
  <ul>
  <li>Mongoose version: 5.8.11</li>
  <li>Node version: 12.13.1</li>
  <li>OS: MacOS Catalina v10.15</li>
  </ul>
  
  <p><strong>Model.ts:</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>const Models: {[key: string]: SchemaDefinition} = {
    activity: {
      banner: { type: Boolean, default: false },
      customer: { type: String, default: null },
      description: { type: String, required: true },
      time: { type: String, default: null },
      title: { type: String, required: true },
      type: { type: String, required: true },
    },
  };
  
  for (const model in Models) {
    if (model) {
      mongoose.model(model, new Schema(Models[model]));
    }
  }
  
  export function getModel (modelType: ModelType): Model&lt;Document, {}&gt; {
    return mongoose.model(modelType);
  }
  </code></pre>
  
  <p><strong>Router.ts</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>const Activity = getModel('activity');
  
  Router.get('/', (req, res) =&gt; {
    const { type } = req.query;
    const conditions =  type ? { type } : null;
  
    Activity.find(conditions, filter)
      .limit(20)
      .exec((err, doc) =&gt; {
        if (err) {
          return res.status(HttpStatus.ServerError)
            .json('Something went wrong when finding activities.');
        }
        if (doc) {
          return res.status(HttpStatus.OK)
            .json({ data: doc });
        }
      });
  });
  </code></pre>
  
  <p>The node app will crash only when I pass callback to <code>find()</code> or <code>enter()</code>.</p>
  
  <p><strong>Errors are as follows:</strong></p>
  
  <pre><code>/Users/backend/node_modules/mongoose/lib/query.js:1915
        return callback(err);
               ^
  TypeError: cb is not a function
      at /Users/backend/node_modules/mongoose/lib/query.js:4378:14
      at cb (/Users/backend/node_modules/mongoose/lib/query.js:1915:14)
      at /Users/backend/node_modules/mongodb/lib/operations/execute_operation.js:76:14
      at executeCallback (/Users/backend/node_modules/mongodb/lib/operations/execute_operation.js:67:25)
      at handleCallback (/Users/backend/node_modules/mongodb/lib/utils.js:129:55)
      at /Users/backend/node_modules/mongodb/lib/operations/to_array.js:30:40
      at ClientSession.endSession (/Users/backend/node_modules/mongodb/lib/core/sessions.js:135:41)
      at Cursor.CoreCursor._endSession (/Users/backend/node_modules/mongodb/lib/core/cursor.js:399:15)
      at /Users/backend/node_modules/mongodb/lib/operations/to_array.js:30:22
      at /Users/backend/node_modules/mongodb/lib/core/cursor.js:750:9
      at done (/Users/backend/node_modules/mongodb/lib/core/cursor.js:463:7)
      at /Users/backend/node_modules/mongodb/lib/core/cursor.js:547:11
      at /Users/backend/node_modules/mongodb/lib/operations/execute_operation.js:76:14
      at executeCallback (/Users/backend/node_modules/mongodb/lib/operations/execute_operation.js:67:25)
      at callbackWithRetry (/Users/backend/node_modules/mongodb/lib/operations/execute_operation.js:135:14)
      at /Users/backend/node_modules/mongodb/lib/core/sdam/server.js:318:7
  </code></pre>