Erstellen einer mongodb capped-collection in java

Möchte ich zum erstellen einer capped-collection von Java-code. Ich fand die syntax für die Erstellung über JavaScript, aber nicht finden konnte, ein Beispiel für Java.

Mongo mongo = new Mongo("127.0.0.1");
DB db = mongo.getDB("mydbid");

DBCollection collection;
if (db.collectionExists("mycollection")) {
        collection = db.getCollection("mycollection");
    } else {
        collection = /* ????? Create the collection ?????? */
    }
}
InformationsquelleAutor Lee Jensen | 2012-06-27
Schreibe einen Kommentar