Comments (5)
You can connect to a replica set as described here: #4
'mongodb' => array(
'host' => 'db1.example.net:27017,db2.example.net:27017',
'database' => 'database',
'options' => array(
'replicaSet' => 'myReplSetName'
)
),
I will try to make this more easier and better documented.
from laravel-mongodb.
I updated the DSN method an readme to allow an easier connection to multiple hosts d8f6b83.
from laravel-mongodb.
Looks good to me. Cleaner than what I was trying to implement.
Will test on my end.
from laravel-mongodb.
works great.
Thanks
from laravel-mongodb.
hi @jenssegers I have followed the same configuration for connecting a cluster of databases.
I'm getting the MongoCursorException not master and slaveOk=false..
'mongodb' => array(
'driver' => 'mongodb',
'host' => array('db1:27017','db2:27017'),
'username' => '',
'password' => '',
'database' => 'database',
'options' => array('replicaSet' => 'replicaSetName'),
),
any configuration I have missed here.?
Thanks
from laravel-mongodb.
Related Issues (20)
- [BUG] hasMany and hasOne relation not working with ObjectId HOT 2
- toSql() Alias from toMql() HOT 4
- [Feature Request] Add enum collection cast HOT 1
- MongoDB\Driver\Exception\BulkWriteException: not primary in /app/vendor/mongodb/mongodb/src/Operation/Update.php:209 HOT 2
- Polymorphic One to One (MorphOne) Relationship [Feature Request] HOT 3
- BelongsToMany detach() doesn't remove id from both collections
- Transaction level not working when use closure
- Unique Rule ignoring fails
- morphOne $model (mysql) -> relation (mongo)
- how it's will work with laravel passport with crearting issue not able to generate personal access token or password HOT 1
- updateOrCreate does not create DB entries HOT 9
- PHPStan errors after 4.3.0 upgrade HOT 1
- How I use laravel passport with this mongodb package ? As I creating Apis for my project so I require passport package. HOT 1
- `createOrFirst` is not triggering `creating` nor `created` model events HOT 8
- [Feature Request] getChanges() not supported HOT 4
- updateOrCreate -> createOrFirst doesn't work as expected HOT 3
- Memory leak when setting nested keys using dot notation HOT 3
- [Feature Request] Use transaction in AWS DocumentDB HOT 1
- whereHas does not work with ObjectId relations HOT 1
- [Feature Request] SANCTUM SUPPORT HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-mongodb.