Examples of MongoClient


Examples of com.mongodb.MongoClient

        collection.remove(new BasicDBObject("_id", "frank"));
    }

    private static DBCollection createCollection() throws UnknownHostException {
        MongoClient client = new MongoClient();
        DB db = client.getDB("students");
        DBCollection collection = db.getCollection("grades");
        //collection.drop();
        return collection;
    }
View Full Code Here

Examples of com.mongodb.MongoClient

public class Hinting {

    public static void main(String[] args) throws UnknownHostException {

        MongoClient client = new MongoClient();
        DB db = client.getDB("test");

        BasicDBObject query = new BasicDBObject("a", 40000);
        query.append("b",40000);
        query.append("c",40000);
View Full Code Here

Examples of com.streamreduce.storm.MongoClient

    ConnectionSpout connectionSpout;

    @Before
    public void setUp() throws Exception {
        MongoClient mockMongoClient = mock(MongoClient.class);
        when(mockMongoClient.getConnections()).thenThrow(new RuntimeException("mongo failure"));
        when(mockMongoClient.getConnection(anyString())).thenThrow(new RuntimeException("mongo failure"));

        Logger mockLogger = mock(Logger.class);

        connectionSpout = new ConnectionSpout();
        ReflectionTestUtils.setField(connectionSpout, "mongoClient", mockMongoClient);
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.