Serialization of a User Object

Serialization of a User Object
0

#1

How do I solve this?

passport.deserializeUser((id, done) => {
        
  [Gives error here] --> db.collection('users').findOne(
            {_id: new ObjectID(id)},
            (err, doc) => {
                done(null, doc);
            }
        );
  done(null, null)
    });

MongoDB is already in dependencies:

{
  "//1": "describes your app and its dependencies",
  "//2": "https://docs.npmjs.com/files/package.json",
  "//3": "updating this file will download and update your packages",
  "name": "FCC-Advanced-Node-and-Express",
  "author": "http://github.com/JosephLivengood",
  "version": "0.0.1",
  "description": "What am I about?",
  "main": "server.js",
  "scripts": {
    "start": "node server.js"
  },
  "dependencies": {
    "express": "^4.16.4",
    "cors": "^2.8.4",
    "body-parser": "^1.18.3",
    "mongodb": "^3.1.8",
    "helmet": "^3.14.0",
    "pug": "^2.0.3",
    "passport": "^0.4.0",
    "express-session": "^1.15.6"
  },
  "engines": {
    "node": "4.4.3"
  },
  "repository": {
    "type": "git",
    "url": "https://hyperdev.com/#!/project/welcome-project"
  },
  "keywords": [
    "node",
    "hyperdev",
    "express"
  ],
  "license": "MIT"
}