sort() for c++ client

This commit is contained in:
Dwight
2009-01-29 18:38:35 -05:00
parent 9406c59f80
commit dcf90d4def
11 changed files with 112 additions and 51 deletions

View File

@@ -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 ) );
}