Package com.fourspaces.couchdb

Examples of com.fourspaces.couchdb.AdHocView


  @Test
  public void adhoc_query_string() {
   
    // Establish that all results are returned with our view
    int all = foo.getAllDocuments().getResults().size();
    AdHocView view = new AdHocView("function (doc) { emit(null, doc);}");
    ViewResults results = foo.adhoc(view);
    assertNotNull(results);
    assertEquals( "Expected results to return all records", all, results.getResults().size() );
 
    // Now set a limit on the number of results that may be returned
    // and verify that only that number of results are returned.
    view.setLimit(2);
    results = foo.adhoc(view);
   
    assertNotNull(results);
    assertEquals( "Expected a subset of records to be returned", 2, results.getResults().size() );
  
View Full Code Here

TOP

Related Classes of com.fourspaces.couchdb.AdHocView

Copyright © 2018 www.massapicom. 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.