Package com.couchbase.client.protocol.views

Examples of com.couchbase.client.protocol.views.ViewDesign


  private void createAndWaitForDesignDocs(CouchbaseClient client) {
    DesignDocument designDoc = new DesignDocument("test_beers");
    String mapFunction = "function (doc, meta) { if(doc._class == "
      + "\"org.springframework.data.couchbase.core.Beer\") { emit(doc.name, null); } }";
    designDoc.setView(new ViewDesign("by_name", mapFunction));
    client.createDesignDoc(designDoc);
  }
View Full Code Here


  private void createAndWaitForDesignDocs(CouchbaseClient client) {
    DesignDocument designDoc = new DesignDocument("user");
    String mapFunction = "function (doc, meta) { if(doc._class == \"org.springframework.data.couchbase.repository." +
      "User\") { emit(null, null); } }";
    designDoc.setView(new ViewDesign("all", mapFunction, "_count"));
    client.createDesignDoc(designDoc);
  }
View Full Code Here

  }

  private void createAndWaitForDesignDocs(final CouchbaseClient client) {
    DesignDocument designDoc = new DesignDocument("user");
    String mapFunction = "function (doc, meta) { if(doc._class == \"org.springframework.data.couchbase.repository.User\") { emit(null, null); } }";
    designDoc.setView(new ViewDesign("customFindAllView", mapFunction, "_count"));

    client.createDesignDoc(designDoc);

    designDoc = new DesignDocument("userCustom");
    designDoc.setView(new ViewDesign("customCountView", mapFunction, "_count"));

    client.createDesignDoc(designDoc);
  }
View Full Code Here

TOP

Related Classes of com.couchbase.client.protocol.views.ViewDesign

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.