I am writing a NodeJS server with ExpressJS, PassportJS, MongoDB and MongooseJS. I just managed to get PassportJS to use user data obtained via Mongoose to authenticate.
If the schema of id is not of type ObjectId you cannot operate with function : findbyId()