sailsjs use mongodb without ORM
问题 I want to use mongodb with sails but without any ORM. So below is my service to connect mongodb. Service: //DbService.js const MongoClient = require('mongodb').MongoClient; module.exports = { db:function(req, res){ var connect=MongoClient.connect("mongodb:***********").then(function (err, database) { if(err) console.log(err); else{ database=database.db('*****'); return connect; } }); } } After connection i have called it in controller, But getting TypeError: Cannot read property 'then' of