Search in sources :

Example 1 with BasicQuery

use of org.springframework.data.document.mongodb.query.BasicQuery in project spring-data-document-examples by spring-projects.

the class MvcAnalyticsTest method queryCounterData.

@Test
public void queryCounterData() {
    DBObject query = QueryBuilder.start("name").is("SignUpController").get();
    for (DBObject dbo : operations.getCollection("counters").find(query)) {
        System.out.println(dbo);
    }
    List<ControllerCounter> counters = operations.find(new BasicQuery("{ 'name' : 'SignUpController'} "), ControllerCounter.class, "counters");
    for (ControllerCounter controllerCounter : counters) {
        System.out.println(controllerCounter);
    }
}
Also used : BasicQuery(org.springframework.data.document.mongodb.query.BasicQuery) ControllerCounter(org.springframework.data.document.analytics.ControllerCounter) BasicDBObject(com.mongodb.BasicDBObject) DBObject(com.mongodb.DBObject) Test(org.junit.Test)

Aggregations

BasicDBObject (com.mongodb.BasicDBObject)1 DBObject (com.mongodb.DBObject)1 Test (org.junit.Test)1 ControllerCounter (org.springframework.data.document.analytics.ControllerCounter)1 BasicQuery (org.springframework.data.document.mongodb.query.BasicQuery)1