Before executing a database query, you must import the database model into the file where you will perform the query (usually your model file).
// sql
const db = require('./knex')();
// mongo
const mongoose = require('mongoose');
// knex
return await db('user').select('*').where({ account_id: account });
// mongoose
return await User.findOne({ account_id: account });