Skip to content

Instantly share code, notes, and snippets.

@koladilip
Created March 21, 2024 18:51
Show Gist options
  • Save koladilip/6a8b477016589e81b2438dc65fa65cc2 to your computer and use it in GitHub Desktop.
Save koladilip/6a8b477016589e81b2438dc65fa65cc2 to your computer and use it in GitHub Desktop.
Example demonstrate the descendant operator (..):
{"code":".employees..name","name":"descendant-operator","type":"JsonTemplate","data":"{\n \"employees\": [\n {\n \"id\": 1,\n \"name\": \"John\",\n \"department\": \"Sales\",\n \"subordinates\": [\n {\n \"id\": 2,\n \"name\": \"Alice\",\n \"department\": \"Marketing\"\n },\n {\n \"id\": 3,\n \"name\": \"Bob\",\n \"department\": \"Sales\"\n }\n ]\n },\n {\n \"id\": 4,\n \"name\": \"Emily\",\n \"department\": \"HR\",\n \"subordinates\": [\n {\n \"id\": 5,\n \"name\": \"Charlie\",\n \"department\": \"HR\"\n },\n {\n \"id\": 6,\n \"name\": \"David\",\n \"department\": \"Finance\"\n }\n ]\n }\n ]\n}\n","bindings":"const bindings = {\n \"description\": \"Enter your bindings here\"\n };"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment