sort() for c++ client
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "mongo/client/dbclient.h"
|
||||
#include "client/dbclient.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace mongo;
|
||||
@@ -20,8 +20,8 @@ int main() {
|
||||
|
||||
conn.remove( ns , emptyObj );
|
||||
|
||||
conn.insert( ns , BUILDOBJ( "name" << "eliot" << "num" << 17 ) );
|
||||
conn.insert( ns , BUILDOBJ( "name" << "sara" << "num" << 24 ) );
|
||||
conn.insert( ns , BSON( "name" << "eliot" << "num" << 17 ) );
|
||||
conn.insert( ns , BSON( "name" << "sara" << "num" << 24 ) );
|
||||
|
||||
auto_ptr<DBClientCursor> cursor = conn.query( ns , emptyObj );
|
||||
cout << "using cursor" << endl;
|
||||
@@ -30,5 +30,5 @@ int main() {
|
||||
cout << "\t" << obj.jsonString() << endl;
|
||||
}
|
||||
|
||||
conn.ensureIndex( ns , BUILDOBJ( "name" << 1 << "num" << -1 ) );
|
||||
conn.ensureIndex( ns , BSON( "name" << 1 << "num" << -1 ) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user