Skip to content

Transaction numbers are only allowed on a replica set member or mongos #1874

@jeremiarm

Description

@jeremiarm

Hello
so i create a simple CRUD with env and database config just like the guide. I can do READ, Update, and Delete but getting this error(of the title) when do INSERT with ->save().

this is the config/database.php

'mongodb' => [
'driver' => 'mongodb',
'host' => env('DB_HOST', '192.168.16.53'),
'port' => env('DB_PORT', 27017),
'database' => env('DB_DATABASE'),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'options' => [
'database' => 'admin',
]
],

and the .env

DB_CONNECTION=mongodb
DB_HOST=192.168.16.53
DB_PORT=27017
DB_DATABASE=shoes
DB_USERNAME=mongo-admin
DB_PASSWORD=password

i am using vagrant server for mongodb, and following https://www.linode.com/docs/databases/mongodb/build-database-clusters-with-mongodb/ tutorial for database clustering. only create not working, update read delete works

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions