express mongodb 报错

D:\blog>npm start

> blog@0.0.0 start D:\blog
> node ./bin/www

(node:10556) 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
  blog:server Listening on port 3000 +0ms
GET /error 404 10.885 ms - 363
GET /stylesheets/style.css 200 3.163 ms - 980
GET /error 404 3.812 ms - 363
GET /stylesheets/style.css 304 2.887 ms - -
GET /error 404 4.709 ms - 363
GET /stylesheets/style.css 304 0.911 ms - -
GET /error 404 2.261 ms - 363
GET /stylesheets/style.css 304 0.722 ms - -
GET /error 404 1.378 ms - 363
GET /stylesheets/style.css 304 2.227 ms - -

clipboard.png

阅读 2.9k
2 个回答

上面不是说了嘛?用啥替代啥。

构建Schema实例的时候,第一个参数为字段对象,第二个参数是collection对象,检查一下是不是第二个参数没有传或者传错。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题