I tried to upgrade my project to v7 with following this document.
After I did these changes now I am getting these warnings.
The mongoose option is not supported anymore. Please remove this option.
{}
modelsDir is not supported anymore. Please remove this option.
{}
Feature(s) impacted
Observed behavior
Expected behavior
Failure Logs
Context
- Project name: …
- Team name: …
- Environment name: …
- Agent type & version: …
- Recent changes made on your end if any: …
Hello @nodejsmaster,
Can you please copy/paste here the code you use to initialize the agent?
Hi @GuillaumeGautreau ,
I have no agents in my code, version of forest-express-mongoose was 6.7.2.
Firstly, i am trying to upgrade it v7.
Can you show me the code that initialize the liana (that’s the other name of agent). Some options just changed their name, some other have been removed.
The correct way to initialize the forest liana with the version 7 is with:
const { objectMapping, connections } = require('../models');
module.exports = async function forestadmin(app) {
app.use(await Liana.init({
configDir: path.join(__dirname, '../forest'),
envSecret: process.env.FOREST_ENV_SECRET,
authSecret: process.env.FOREST_AUTH_SECRET,
objectMapping,
connections,
}));
console.log(chalk.cyan('Your admin panel is available here: https://app.forestadmin.com/projects'));
};
You can:
- Remove your current
mongoose
option as it is now ignored
- Remove your current
modelsDir
option, as it is now ignored
- add
objectMapping
and pass Mongoose
, required from mongoose
- add
connections
and pass an object containing the mongoose connection, for instance { db: connection }