JSON

JSON documents stored natively, read and changed in place by JSONPath: nested values, arrays and objects, numbers and strings.

26 commands in KiviDB 1.2.0. Every command.

  • JSON.ARRAPPEND: Appends one or more values to the end of each array path matches in the JSON document at key.
  • JSON.ARRINDEX: Returns the index of the first element equal to value, JSON text, in each array path matches, from start to stop.
  • JSON.ARRINSERT: Inserts one or more values into each array path matches, before the element at index.
  • JSON.ARRLEN: Returns the number of elements in each array path matches in the JSON document at key.
  • JSON.ARRPOP: Removes and returns an element from each array path matches: the last one, or the one at index.
  • JSON.ARRTRIM: Keeps only the elements from start to stop, both included, in each array path matches.
  • JSON.CLEAR: Resets values in a JSON document without removing them: each array and object path matches is emptied, and each number becomes 0.
  • JSON.DEBUG: A container for commands that report on JSON documents rather than read or change them.
    • JSON.DEBUG HELP: Lists the JSON.DEBUG subcommands, one line each, with their arguments and what they do.
    • JSON.DEBUG MEMORY: Reports the size, in bytes, of each value path matches in the JSON document at key, or of the whole document with no path.
  • JSON.DEL: Deletes the values path matches in the JSON document at key.
  • JSON.FORGET: Another name for JSON.DEL: it takes the same arguments and gives the same reply.
  • JSON.GET: Returns values from the JSON document at key, as JSON text.
  • JSON.MERGE: Merges value into each value path matches, as an RFC 7396 merge patch: members are merged into objects, null deletes a member, and anything else replaces.
  • JSON.MGET: Evaluates path in the JSON documents at several keys.
  • JSON.MSET: Runs JSON.SET for several key, path and value triples in one command.
  • JSON.NUMINCRBY: Adds number to each number path matches.
  • JSON.NUMMULTBY: Multiplies each number path matches in the JSON document at key by number, and stores the result in place.
  • JSON.OBJKEYS: Returns the member names of each object path matches in the JSON document at key.
  • JSON.OBJLEN: Returns the number of members in each object path matches in the JSON document at key.
  • JSON.RESP: Returns each value path matches in RESP rather than JSON text: null as nil, booleans as true and false, integers as integers, other numbers and strings as bulk strings, an array as [ followed by its…
  • JSON.SET: Sets the value at path in the JSON document at key to value, which is JSON text.
  • JSON.STRAPPEND: Appends a JSON string to each string path matches.
  • JSON.STRLEN: Returns the length of each string path matches in the JSON document at key.
  • JSON.TOGGLE: Flips each boolean path matches in the JSON document at key: true becomes false and false becomes true.
  • JSON.TYPE: Returns the type of each value path matches: object, array, string, integer, number, boolean or null.