Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: MongoDB and WriteConcern

by andal (Hermit)
on Mar 31, 2017 at 05:47 UTC ( #1186585=note: print w/replies, xml ) Need Help??


in reply to Re: MongoDB and WriteConcern
in thread MongoDB and WriteConcern

Sorry, as usually I forgot that people don't know the context of my question. I do know how to use perl and perl modules. I just was hoping that someone knows how to use specific feature of MongoDB via perl module. I guess this is wrong place to ask such questions. It would be better to contact some mailing list of MongoDB module users.

Anyway, it looks like I've found the answer myself. When connecting to MongoDB one can specify WriteConcern using attributes w, j, and wtimeout. This is described in perldoc MongoDB::MongoClient. So the connecting code would look like

my $cnx = MongoDB::MongoClient->new( host => 'mongodb://myhost1,myhost2', w => 'majority', j => 1, wtimeout => 10000, replicaSet => 'myset');
At least this way after killing primary I don't loose data anymore.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1186585]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2022-01-16 11:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (49 votes). Check out past polls.

    Notices?