Skip to content

Instantly share code, notes, and snippets.

@kgorman
Created August 11, 2010 21:00
Show Gist options
  • Select an option

  • Save kgorman/519755 to your computer and use it in GitHub Desktop.

Select an option

Save kgorman/519755 to your computer and use it in GitHub Desktop.
public void run(){
double N = 20000;
for ( int i=0; i<N; i++ ){
BasicDBObject o = new BasicDBObject( "_id" , UPTO.getAndIncrement() );
coll.insert( o );
}
db.getLastError(2); // commit
}
.....
db = mongo.getDB( "test" );
coll = db.getCollection( "Foo" );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment