Make sure the first parameter to mongoose.connect()
or mongoose.createConnection()
is a string. MongooseError: The uri
parameter to openUri()
must be a string, got "undefined". Make sure the first parameter to mongoose.connect()
or mongoose.createConnection()
is a string.
here is my app.module.ts file
imports: [MongooseModule.forRoot(process.env.MONGO_URI,{
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true,
})],
controllers: [],
providers: [],
})
export class AppModule {}```
1条答案
按热度按时间km0tfn4u1#
您需要设置配置。请阅读以下内容:https://docs.nestjs.com/techniques/configuration