What is the preferred method for setting readPreference using perl mongo driver

110 views
Skip to first unread message

Taylor Fort

unread,
Oct 5, 2012, 3:17:48 PM10/5/12
to mongod...@googlegroups.com
I have a script that's using perl to connect to a mongo cluster through mongos.  There is already the Cursor functionality in setting slaveOk, but I was wondering what people are doing to set the readPreference (for example setting it to 'nearest').  

Roman Alexis Anastasini

unread,
Oct 5, 2012, 3:50:51 PM10/5/12
to mongod...@googlegroups.com
Hi Taylor,

Have a look here:
Especially the v2.2 stuff is an interesting read.

Second have a look here:

Dunno the exact perl syntax here, but you should figure it out, as you have the cursor set up. :-)

Hope that helps.

Cheers,
Roman

Roman Alexis Anastasini
Senior Web Developer
CMUNE

On Oct 6, 2012, at 3:17 AM, Taylor Fort <taylo...@gmail.com> wrote:

I have a script that's using perl to connect to a mongo cluster through mongos.  There is already the Cursor functionality in setting slaveOk, but I was wondering what people are doing to set the readPreference (for example setting it to 'nearest').  

--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb
Reply all
Reply to author
Forward
0 new messages