summaryrefslogtreecommitdiff
path: root/src/mongo/client/query.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/client/query.h')
-rw-r--r--src/mongo/client/query.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/client/query.h b/src/mongo/client/query.h
index 37af5b0659e..68e972063b9 100644
--- a/src/mongo/client/query.h
+++ b/src/mongo/client/query.h
@@ -159,6 +159,10 @@ private:
}
};
+inline std::ostream& operator<<(std::ostream& s, const Query& q) {
+ return s << q.toString();
+}
+
void assembleQueryRequest(const std::string& ns,
BSONObj query,
int nToReturn,
@@ -167,4 +171,9 @@ void assembleQueryRequest(const std::string& ns,
int queryOptions,
Message& toSend);
+/** Typically one uses the QUERY(...) macro to construct a Query object.
+Example: QUERY( "age" << 33 << "school" << "UCLA" )
+*/
+#define QUERY(x) ::mongo::Query(BSON(x))
+
} // namespace mongo