Hi Jeremy!
Unfortunately, it's not possible to query a hidden replica set member with a sharded cluster in the current production version of MongoDB (v 2.0.6).
In that version, the best that you can do is issue your queries with the 'SlaveOK' flag set. This will serve as a hint to 'mongos' that it can safely route your query to one of the secondary members of the replica set.
New support for "Read Tagging" is currently in development for the upcoming release of MongoDB. This is an extension of the existing support for "Write Tagging".
The current support for "Write Tagging" allows you to tag individual members of a Replica Set. Once you've done that, you can use special options on the Write Concern to specify which replica set members (actually, which tags) you'd like the write to be directed to.
You can read more about "Write Tagging" here:
-
http://www.mongodb.org/display/DOCS/Data+Center+Awareness#DataCenterAwareness-Tagging%28version2.0%29The upcoming support for "Read Tagging" will extend this functionality to reads. Once your MongoDB driver has been extended to support "Read Tagging", you will be able to direct your read to a particular set of tagged replica set members, even when you're using a sharded cluster.
The Jira issues that cover this are:
-
https://jira.mongodb.org/browse/SERVER-3358 -
https://jira.mongodb.org/browse/SERVER-4464Please feel free to add yourself as a follower on these issues.
Let me know if you have further questions.
-William