zoukankan      html  css  js  c++  java
  • nodejs mongoose连接mongodb报错,command find requires authentication

    MongoError: command find requires authentication
        at Connection.<anonymous> (/home/Map/node_modules/mongodb-core/lib/connection/pool.js:443:61)
        at Connection.emit (events.js:310:20)
        at processMessage (/home/Map/node_modules/mongodb-core/lib/connection/connection.js:364:10)
        at Socket.<anonymous> (/home/Map/node_modules/mongodb-core/lib/connection/connection.js:533:15)
        at Socket.emit (events.js:310:20)
        at addChunk (_stream_readable.js:286:12)
        at readableAddChunk (_stream_readable.js:268:9)
        at Socket.Readable.push (_stream_readable.js:209:10)
        at TCP.onStreamRead (internal/stream_base_commons.js:186:23) {
      ok: 0,
      errmsg: 'command find requires authentication',
      code: 13,
      codeName: 'Unauthorized',
      operationTime: Timestamp { _bsontype: 'Timestamp', low_: 13, high_: 1617034825 },
      '$clusterTime': {
        clusterTime: Timestamp { _bsontype: 'Timestamp', low_: 13, high_: 1617034825 },
        signature: { hash: [Binary], keyId: [Long] }
      },
      [Symbol(mongoErrorContextSymbol)]: {}
    }
    

     问题:mongoose版本太高了,,在package.json中,将版本改为 

       "mongoose": "^5.9.7",重新npm i即可
  • 相关阅读:
    2.27
    string.Format("{0,-50}", "qqqqqqqqqqqq")
    dataGridView
    dataGridView添加列行
    设置拖拽事件,获取拖拽内容
    ,鼠标右键,将ListView的内容存入剪贴板
    winform ListView点击行表头,排序
    Aes加密解密
    C#get ,post HttpClient
    将json格式的string转化为对象
  • 原文地址:https://www.cnblogs.com/qiyc/p/14596676.html
Copyright © 2011-2022 走看看