Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
is it possible to make query to primary when slaveOk is true
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sergejs Degtjars  
View profile  
 More options Aug 1 2012, 9:05 am
From: Sergejs Degtjars <sergedegt...@gmail.com>
Date: Wed, 1 Aug 2012 06:05:55 -0700 (PDT)
Local: Wed, Aug 1 2012 9:05 am
Subject: is it possible to make query to primary when slaveOk is true

I have shareded cluster. My application connects to mongos with
slaveOk=true.
I some situation I need to check existence of document with concrete value,
and if it isn't present allow to insert new, or deny insert if it exists.
In stress load, we are discovered possibility to get wrong reply to query,
because it queries slaves when replication isn't done.

Is there possibility using 10gen C# driver to call MongoCollection.FindOne
method with primary node as target?

Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
craiggwilson  
View profile  
 More options Aug 3 2012, 10:13 am
From: craiggwilson <craiggwil...@gmail.com>
Date: Fri, 3 Aug 2012 07:13:56 -0700 (PDT)
Local: Fri, Aug 3 2012 10:13 am
Subject: Re: is it possible to make query to primary when slaveOk is true

You cannot call FindOne with a different slave ok value.  However, FindOne
is just a helper for Find(...).Limit(1).  Since Find returns a MongoCursor,
you can set the slaveOk value there.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »