mongodb / laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)

Home Page:https://www.mongodb.com/compatibility/mongodb-laravel-integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MongoDB\Driver\Exception\BulkWriteException: not primary in /app/vendor/mongodb/mongodb/src/Operation/Update.php:209

masterbater opened this issue · comments

  • Laravel-mongodb Version:4.2.0
  • PHP Version: 8.3
  • Database Driver & Version:

There is a race problem when using firstOrNew

stack trace
image

Looking at the stack trace, I don't see where you are using firstOrNew.

This error suggests that the command is unable to run on a secondary node because it requires a primary node.

If you use a replica set without load-balancer, you must list all the server hosts in the connection URI.

Looking at the stack trace, I don't see where you are using firstOrNew.

This error suggests that the command is unable to run on a secondary node because it requires a primary node.

If you use a replica set without load-balancer, you must list all the server hosts in the connection URI.

Im using mongodb atlas