Wednesday, August 31, 2011

JSON - Accessing object with hypen/dash

If you encounter json object that have - (hypen/dash) in the key, you will get a reference error if you access the object with dot manner. For example

{"cam-id":"1"}

Assuming the above object is call json_results, you will get an reference error if you

json_results.cam-id

You have to access the value by

json_results["cam-id"]

No comments:

Post a Comment

Oracle - ORACLE error 959 encountered when importing with imp

If the dump is exported with imp, you cannot use impdp and you may face issue such as IMP-00003: ORACLE error 959 encountered ORA-009...