I’d like to use the java client to perform upserts of my Design Documents programatically. It looks like this functionality exists but something seems to be missing. I define some of my Design Documents with auto update options. If I fetch the Design Document using the REST API, the resulting JSON looks something like this:
{
"views" : {
"openByModified" : {
"map" : "function (doc, meta) {\n if(typeof doc.lastModified !== \"undefined\" && doc.open) {\n emit(doc.lastModified, null);\n }\n }"
}
},
"options" : {
"updateInterval" : 60000,
"updateMinChanges" : 1,
"replicaUpdateMinChanges" : 1
}
}
It’s that options section that I need support for in programmatically upserting a DesignDocument but I don’t see any coverage for this in the current (2.0.2) api. I can parse equivalent JSON into a Map and then use JsonObject.from
to give me a JsonObject
to plug into the DesignDocument
constructor, but it seems like the options
section is lost when I do this. Am I missing something or is this just not covered in the current API?