summaryrefslogtreecommitdiff
path: root/src/mongo/client/dbclientinterface.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/client/dbclientinterface.h')
-rw-r--r--src/mongo/client/dbclientinterface.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/client/dbclientinterface.h b/src/mongo/client/dbclientinterface.h
index 95d7e1c6a23..37ad9533078 100644
--- a/src/mongo/client/dbclientinterface.h
+++ b/src/mongo/client/dbclientinterface.h
@@ -324,6 +324,10 @@ namespace mongo {
*/
class Query {
public:
+ static const BSONField<BSONObj> ReadPrefField;
+ static const BSONField<std::string> ReadPrefModeField;
+ static const BSONField<BSONArray> ReadPrefTagsField;
+
BSONObj obj;
Query() : obj(BSONObj()) { }
Query(const BSONObj& b) : obj(b) { }
@@ -399,6 +403,14 @@ namespace mongo {
Query& where(const string &jscode) { return where(jscode, BSONObj()); }
/**
+ * Sets the read preference for this query.
+ *
+ * @param pref the read preference mode for this query.
+ * @param tags the set of tags to use for this query.
+ */
+ Query& readPref(ReadPreference pref, const BSONArray& tags);
+
+ /**
* @return true if this query has an orderby, hint, or some other field
*/
bool isComplex( bool * hasDollar = 0 ) const;