You are not logged in.
Pages: 1
Hi,
in MOrmot 2, it's possibile to add some options to RetrieveListJson() for "compact" Json result?
I intend similar to the [ToNonExpandedJson] for a packed "CSV" format and [DontStoreVoid] for smaller Json result (alternative of course).
I want obtain best performance possible without convert Json result in TDocVariant with performance penalty, and for response with a compact Json result, where possible.
Thanks a lot!!
Offline
IIRC RetrieveListJson() has aForceAjax=false by default which returns the "compact" JSON result.
You can also force it by setting TRestServer.NoAjaxJson := true.
Note that you have already an IRestOrm.RetrieveDocVariantArray() method to create a TDocVariant.
Offline
It seems that only aForceAjax=false by default don't works.
Instead with TRestServer.NoAjaxJson := true it works well. Thanks a lot!
A different serialization:
There is a way for obtain a direct serialization for a JSON with "[DontStoreVoid]" option for a
IRestOrm.RetrieveDocVariantArray() (or other Retrieve...)? I don't find this capability natively.
Naturally the fastest way possible...
Thanks in advance!
Offline
There is no such method directly.
Because in practice, it is likely to be slower than always putting all fields.
My guess is that a custom method working at ORM level, using TOrmPropInfo.IsValueVoid and TOrmPropInfo.GetVariant could help, if you really need it.
Offline
OK, perfect.
Thanks a lot :-)
Offline
Pages: 1