
please wait
void printQuery(DBClientConnection &c, std::string &dc, const Query &qu = BSONObj(), std::string sortby = "" )
cursor = c.query(dc,qu.sort(sortby))
error C2663: 'mongo::Query::sort' : 2 overloads have no legal conversion for 'this' pointer.
const Query
with its member function sort. But if I change it to Query&
without the const
, then my parameter initialization = BSONObj()
raises:cannot convert from 'mongo::BSONObj' to 'mongo::Query &'
Query qu
by value, then neither of these problems arise.