(node:71307) [DEP0079] DeprecationWarning

前端 未结 8 1815
故里飘歌
故里飘歌 2021-01-17 21:11

Try to update MongoDB document Getting Deprecation Warning as

(node:71307) [DEP0079] DeprecationWarning: Custom inspection function on Objects via

8条回答
  •  死守一世寂寞
    2021-01-17 21:31

    To solve this problem, You have to use useNewUrlParser and useCreateIndex. See the code below.

    mongoose.connect(
     config.databaseUrl,
     { 
        useNewUrlParser: true, 
        useCreateIndex: true 
     }
    )
    

    Or

    mongoose.set("useCreateIndex", true);    
    mongoose.connect(
        config.databaseUrl,
        { 
            useNewUrlParser: true
        }
      );
    

提交回复
热议问题