mongoose連接報錯

(node:12276) DeprecationWarning: open() is deprecated in mongoose >= 4.11.0, use openUri() instead, or set the useMongoClient option if using connect() or createConnection(). See http://mongoosejs.com/docs/connections.html#use-mongo-client
(node:12276) DeprecationWarning: Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html
------數據庫鏈接成功!------html

解決
仍是能出來結果的,只不過是版本更新了,鏈接方式有變。node

mongoose.connect('mongodb://127.0.0.1:27017/test',{useMongoClient: true});//鏈接數據庫

http://blog.csdn.net/wflk_wangwei/article/details/76176965mongodb

http://blog.csdn.net/nvidiacuda/article/details/73457138數據庫

相關文章
相關標籤/搜索