Domanda

I am given the following JSON structure:

{
    "document": {
        "sections": {
            "x": {
                "title": "foo"
            },
            "y": {
                "title": "bar"
            }
        }
    }
}

How do I update value of the title property for a given section using the HTTP API?

I would like to provide a path (string) to get to the property.

È stato utile?

Soluzione

This was fixed in build 2254. You should now be able to issue a single scripted patch like this:

EVAL http://localhost:8080/docs/foos/1

{Script:"this.document.sections.x.title = newTitle;",Values:{"newTitle":"Whatever"}}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top