JSON.TOGGLE

    Toggle a Boolean value stored at

    Required arguments

    key

    is key to modify.

    is JSONPath to specify. Default is root $.

    Return

    JSON.TOGGLE returns an array of integer replies for each path, the new value (0 if false or if true), or nil for JSON values matching the path that are not Boolean. For more information about replies, see .

    Toogle a Boolean value stored at path

    Create a JSON document.

    1. dragonfly> JSON.SET doc $ '{"bool": true}'
    2. OK

    Get the updated document.

    1. "[{\"bool\":false}]"

    Toggle the Boolean value.

    Get the updated document.

    1. dragonfly> JSON.GET doc $

    See also

    JSON.SET | JSON.GET