MongoError: This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string

前端 未结 4 624
逝去的感伤
逝去的感伤 2021-01-03 22:05

I am using \"mongoose\": \"^5.7.1\" in my Node.js project. I am making an api which involves updating in two documents. So, I am using the transactions like fol

4条回答
  •  [愿得一人]
    2021-01-03 22:27

    Please Edit App/Config/database file Add 'retryWrites'=>false in Mongodb Connection String

    write Mongo db connection

    'mongodb' => [
                'driver'   => 'mongodb',
                'host'     => env('MONGO_DB_HOST', 'lo*****'),
                'port'     => *****,
                'database' => env('MONGO_DB_DATABASE'),
                'username' => env('MONGO_DB_USERNAME'),
                'password' => env('MONGO_DB_PASSWORD'),
                'options'  => [
                    'database'=> env('MONGO_DB_DATABASE'),
                    'retryWrites'=>false
                ]
            ],
    

    Save And Run

提交回复
热议问题