DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
mongoose를 사용할때 뜰 수 있는 경고문구 입니다.
https://mongoosejs.com/docs/deprecations.html
Mongoose v5.9.25: Deprecation Warnings
Deprecation Warnings There are several deprecations in the MongoDB Node.js driver that Mongoose users should be aware of. Mongoose provides options to work around these deprecation warnings, but you need to test whether these options cause any problems for
mongoosejs.com
를 참고하시어 워닝내용을 알 수 있고,
mongoose를 셋팅할때 userCreateIndex를 true로 다시 설정해주시면 경고문구가 더이상 뜨지 않게 됩니다.
mongoose.connect(process.env.MONGODB_URL, {
useNewUrlParser:true,
useFindAndModify:false,
useUnifiedTopology: true,
useCreateIndex: true
});
'개발 > Web Programming' 카테고리의 다른 글
Mongoose populate가 동작하지 않는경우 (0) | 2020.07.28 |
---|---|
Error: There can be only one type named "Mutation". (0) | 2020.07.27 |
Error: Query root type must be provided. (0) | 2020.07.27 |
TypeError: Cannot set property 'subscriptionServerOptions' of undefined (0) | 2020.07.26 |
SyntaxError: The requested module 'graphql-yoga' does not provide an export named 'GraphQLServer' (0) | 2020.07.26 |