boomerang::handler proc as_json (protected)
boomerang::handler as_json dict
Defined in packages/xotcl-core/tcl/01-debug-procs.tcl
- Parameters:
- dict (required)
- Testcases:
- No testcase defined.
Source code: package require json::write #::json::write object {*} set result "" dict map {k v} $dict { # # Some fields (like e.g.restiming) can't be used # easily for elastic search, since it contains names # with dots, and keys starting with dots, which are # interpreted differently in elasticsearch # if {[info exists :json_drop($k)]} { continue } # # We have to map some key containing dots. # if {[info exists :json_map($k)]} { set k [set :json_map($k)] } set entry "\"$k\":" # # Some fields have to be quoted # if {[info exists :json_unquoted($k)]} { append entry $v } else { append entry [::json::write string $v] } lappend result $entry } return "{[join $result ,]}"XQL Not present: Generic, PostgreSQL, Oracle