错误:无法连接到数据库?使用mongodb

fgw7neuy  于 2022-12-12  发布在  Go
关注(0)|答案(1)|浏览(148)

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 {}```

相关问题