Hey guys. I started forest admin project a couple of months ago, when I was using “forest-express-mongoose”: “6.0.0” and at the time, we exported models as Model Type which made it easier to write queries directly through mongoose models.
However, after upgrading forest-express-mongoose to 7.7.1, I am unable to write queries because the models are now returned from a function. I tried the code below but the result doesnt return anything.
const transactionModel = require(’…/models/transactions’);
const mongoose = require(‘mongoose’);
let model = transactionModel(mongoose, mongoose)
let result = await model.findOne({})
Can someone help me on how to query models when it is returned as a function???
Regards,
Tanish P