Permalink
Browse files

Implement operator<< for std::ostream output for mongo::Query

There are such operators for both BSONObj and BSONElement, but for
Query it is absent. Besides all, this is badly needed for tracing.
  • Loading branch information...
1 parent 26e54bc commit 36521f7f5459362cad646fd4c060d012008537ff Yakov Markovitch committed Oct 27, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 client/dbclient.h
View
@@ -973,6 +973,10 @@ namespace mongo {
BSONElement getErrField( const BSONObj& result );
bool hasErrField( const BSONObj& result );
+ inline std::ostream& operator<<( std::ostream &s, const Query &q ) {
+ return s << q.toString();
+ }
+
} // namespace mongo
#include "dbclientcursor.h"

0 comments on commit 36521f7

Please sign in to comment.