public Observable<DesignDocument> upsertDesignDocument(final DesignDocument designDocument, boolean development) {
String body = null;
try {
body = CouchbaseAsyncBucket.JSON_OBJECT_TRANSCODER.jsonObjectToString(designDocument.toJsonObject());
} catch (Exception e) {
throw new TranscodingException("Could not encode design document: ", e);
}
UpsertDesignDocumentRequest req = new UpsertDesignDocumentRequest(designDocument.name(),
body, development, bucket, password);
return core.<UpsertDesignDocumentResponse>send(req)
.map(new Func1<UpsertDesignDocumentResponse, DesignDocument>() {