I want to make Node.js handler how can I do it?

Thanks for the information, how can I fix this?
after i fix this i will use findOne

var mongoDB = require("../mongodb.js");
var warnDB = mongoDB.getConnection().db("admin").collection('coltest');

output:

var warnDB = mongoDB.getConnection().db("admin").collection('coltest');
                                   ^

TypeError: mongoDB.getConnection(...).db is not a function```