##class(%ZEN.Auxiliary.jsonProvider).%WriteJSONStreamFromObject(), Remove _class property
I am converting an object to json, but in the result a "_class" property appears, is there any way to remove this?
Result:
I am converting an object to json, but in the result a "_class" property appears, is there any way to remove this?
Result:
You need to specify pFormat parameter, it defaults to aceloqtw, where:
In your case explicitly remove c: aeloqtw. This is quoted from documentation.
Additionally if you want to output json to the current device it would be better to use %WriteJSONFromObject - it has the same arguments, except stream, so there's no extra object and io redirect costs:
Great Eduard! It worked perfectly, thank you very much!!!
Very good Leo, help me solve a problem
You might want to post your problem as a separate question.
Eduard, thank you very much again, with the% WriteJSONFromObject function I was able to solve a performance issue. Using WriteJSONStreamFromObject () was taking 1 minute, with% WriteJSONFromObject going to 3 seconds!
Great to hear that!
If you're interested in performance, upgrading to 2016.2+ would help tremendously with JSON processing due to the addition of dynamic objects.
Furthermore, upgrading to IRIS 2019.1.1 would add %JSON.Adaptor which simplifies JSON (de)serialization of normal objects.
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue