zoukankan      html  css  js  c++  java
  • TypeError: db.collection is not a function

    出现以下错误时:

    G: odejslogin ode_modulesmongodblibmongo_client.js:797
    throw err;
    ^

    TypeError: db.collection is not a function
    at findRestaurants (G: odejsloginapp.js:22:19)
    at G: odejsloginapp.js:35:3
    at args.push (G: odejslogin ode_modulesmongodblibutils.js:404:72)
    at G: odejslogin ode_modulesmongodblibmongo_client.js:255:5
    at connectCallback (G: odejslogin ode_modulesmongodblibmongo_client.js:933:5)
    at G: odejslogin ode_modulesmongodblibmongo_client.js:794:11
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

    解决方案:

      项目包的package.json文件中,将以下依赖项中的“mongodb”的值修改为以下值即可(“^2.2.33”)

      并重新再目录下执行  npm install语句

      

  • 相关阅读:
    jQuery
    jQuery
    jQuery
    jQuery
    jQuery 遍历- 过滤:缩小搜索元素的范围
    jQuery 遍历
    jQuery 遍历
    jQuery 遍历
    jQuery 遍历:jQuery 遍历 什么是遍历?
    jQuery 尺寸:处理元素和浏览器窗口的尺寸
  • 原文地址:https://www.cnblogs.com/pyj63/p/8135215.html
Copyright © 2011-2022 走看看