couchbase version:4.0
GO SDK:1.0
couchbase number:one
JAVA SDK Creating design documents ,As follows:
CouchbaseCluster cluster = CouchbaseCluster.create(“127.0.0.1”);
Bucket bucket = cluster.openBucket(“mytest”);
// Get bucket manager
BucketManager bucketManager = bucket.bucketManager();
// Initialize design document
DesignDocument designDoc = DesignDocument.create(
“test”,
Arrays.asList(
DefaultView.create(“test”,
“function (doc, meta) { if (doc.timestamp >= 1448603514 && doc.timestamp <= 1448615436 ) {emit([doc.endpoint, doc.metric], [doc.value,doc.timestamp]);}}”))
)
);
// Insert design document into the bucket
bucketManager.insertDesignDocument(designDoc);
1.Go SDK No create function?Can initialize design document?example?
2.Map function “1448603514” and “1448615436” it can be a variable? example?
Many thanks for your help.