Querying an Element
Querying an Element List
Querying a String
Querying a Number
Querying a Boolean
Filtering a Query
Be aware that a filtering expression - the expression in the() - is not allowed to contain double quotes!
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
import static org.camunda.spin.Spin.JSON;
String json = "{\"child\": [{\"id\": 1,\"name\": \"Lucy\",\"sex\": \"female\"},{\"id\": 2,\"name\": \"Tracy\",\"sex\": \"female\"}],\"number\": 1,\"boolean\": true}";
SpinJsonNode child = JSON(json).jsonPath("$.child[0]").element();
import static org.camunda.spin.Spin.JSON;
String json = "{\"child\": [{\"id\": 1,\"name\": \"Lucy\",\"sex\": \"female\"},{\"id\": 2,\"name\": \"Tracy\",\"sex\": \"female\"}],\"number\": 1,\"boolean\": true}";
SpinList<SpinJsonNode> childs = JSON(json).jsonPath("$.child").elementList();
import static org.camunda.spin.Spin.JSON;
String json = "{\"child\": [{\"id\": 1,\"name\": \"Lucy\",\"sex\": \"female\"},{\"id\": 2,\"name\": \"Tracy\",\"sex\": \"female\"}],\"number\": 1,\"boolean\": true}";
String value = JSON(json).jsonPath("$.child[0].name").stringValue();
import static org.camunda.spin.Spin.JSON;
String json = "{\"child\": [{\"id\": 1,\"name\": \"Lucy\",\"sex\": \"female\"},{\"id\": 2,\"name\": \"Tracy\",\"sex\": \"female\"}],\"number\": 1,\"boolean\": true}";
Double count = JSON(json).jsonPath("$.number").numberValue();
import static org.camunda.spin.Spin.JSON;
String json = "{\"child\": [{\"id\": 1,\"name\": \"Lucy\",\"sex\": \"female\"},{\"id\": 2,\"name\": \"Tracy\",\"sex\": \"female\"}],\"number\": 1,\"boolean\": true}";
Boolean exists = JSON(json).jsonPath("$.boolean").boolValue();
() - is not allowed to contain double quotes!
import static org.camunda.spin.Spin.JSON;
String json = "{\"child\": [{\"id\": 1,\"name\": \"Lucy\",\"sex\": \"female\"},{\"id\": 2,\"name\": \"Tracy\",\"sex\": \"female\"}],\"number\": 1,\"boolean\": true}";
SpinList<SpinJsonNode> girls = JSON(json).jsonPath("$.child[?(@.sex == 'female')]").elementList();