Hi, please consider the code below.
    
    
    import json
    
    var field1, field2, field3 : str
    var jz : JsonNode
    
    field1 = jz["node1"].getStr
    field2 = jz["node2"].getStr
    field3 = jz["node3"].getStr
    

Sometimes the nodes node1, node2 and/or node3 are available at my **jz** 
content. But _just_ sometimes... If one of them are absent, an unhandled 
exception will occurs.

In Nim, what is the equivalent command of Python's dict.get(key[, default]) ? I 
would like to checks if the specified key exists in the JsonNode. If it does, 
then returns the value of that key, if not kindly give me let's say a blank 
value.

Best

Reply via email to