Package com.mongodb

Examples of com.mongodb.DBCollection.save()


        DBObject dbobj = db.command( foo );
        DBCollection c = db.getCollection( "capped1" );

        DBObject obj1 = new BasicDBObject();
        obj1.put( "x", 1 );
        c.save( obj1 );
        DBObject obj2 = new BasicDBObject();
        obj2.put( "x", 2 );
        c.save( obj2 );

        foo.put( "create", "capped2" );
View Full Code Here


        DBObject obj1 = new BasicDBObject();
        obj1.put( "x", 1 );
        c.save( obj1 );
        DBObject obj2 = new BasicDBObject();
        obj2.put( "x", 2 );
        c.save( obj2 );

        foo.put( "create", "capped2" );
        foo.put( "size", 1000 );
        db.command( foo );
        String s = "";
View Full Code Here

        String s = "";
        c = db.getCollection( "capped2" );
        for( int i=1; i<= 100; i++ ) {
            DBObject obj = new BasicDBObject();
            obj.put( "dashes", s );
            c.save( obj );
            s = s+"-";
        }
    }
}
View Full Code Here

            DBObject foo = new BasicDBObject();
            foo.put( "name", "asdf"+i );
            foo.put( "date", new Date() );
            foo.put( "id", i );
            foo.put( "blah", blah );
            c.save( foo );
        }

        for( int count=0; count<10000; count++ ) {
            doStuff( c, count );
        }
View Full Code Here

        DBCollection coll = db.getCollection( "part1" );

        for( int i=0; i<100; i++) {
            DBObject o = new BasicDBObject();
            o.put( "x", i );
            coll.save( o );
        }
    }
}
View Full Code Here

        foo.put( "c", b );
        db.getCollection( "a" ).save( foo );

        foo = new BasicDBObject();
        foo.put( "c", 1 );
        b.save( foo );

        ObjectId id = new ObjectId();
        foo = new BasicDBObject();
        foo.put( "_id", id );
        foo.put( "that", 2 );
View Full Code Here

        DB db = new MongoClient().getDB( "driver_test_framework" );
        DBCollection coll = db.getCollection( "dbs_1" );
        DBObject o = new BasicDBObject();
        o.put( "foo", "bar" );
        coll.save( o );

        coll = db.getCollection( "dbs_2" );
        o = new BasicDBObject();
        o.put( "psi", "phi" );
        coll.save( o );
View Full Code Here

        coll.save( o );

        coll = db.getCollection( "dbs_2" );
        o = new BasicDBObject();
        o.put( "psi", "phi" );
        coll.save( o );

        Set<String> set = db.getCollectionNames();
        String[] strs = set.toArray( new String[0] );
        Arrays.sort( strs );
        for( String s : strs ) {
View Full Code Here

        DB db = new MongoClient().getDB( "driver_test_framework" );
        DBCollection c = db.getCollection( "test" );

        DBObject foo = new BasicDBObject();
        foo.put( "a", 2 );
        c.save( foo );
    }
}
View Full Code Here

        DBCursor objects = realms.find(query);
        while (objects.hasNext()) {
            DBObject object = objects.next();
            object.put("codeSecret", KeycloakModelUtils.generateCodeSecret());
            realms.save(object);

            log.debugv("Added realm.codeSecret, id={0}", object.get("id"));
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.