0

Seems that when the collection is initially created there a period where you can't insert docs. So running the code below I only get the first insert.

Mongo mongo = new Mongo("localhost", 27017);
DB db = mongo.getDB( "workqueue" );
DBCollection coll = db.getCollection("jobs");

coll.insert(new BasicDBObject("desc", "test1"));
coll.insert(new BasicDBObject("desc", "test2"));
coll.insert(new BasicDBObject("desc", "test3"));

However, if I put a Thread sleep in between each insert I do get all 3. Is this a bug or am I doing something wrong?

4

0 に答える 0