You are not logged in.
Pages: 1
Hi,
I would like to decode an array of json, for example this one : [{"id":"1","nom":"test1.sql","dti":"2016-02-19 09:49:31"},{"id":"2","nom":"test2.sql","dti":"2016-02-19 09:50:12"}]
When I use the JSONDecode function : "JSONDecode(input, ['id'], output);" , I receive only id = 1. My question is simple, how can I receive an array of values.
Thank you
Delphi 2010 - Delphi XE5 (x64 Apps) - CodeTyphon - Typhon IDE v 5.7 - FPC 3.1.1 - mORMot 1.18
Windows 7 - VirtualBox : Linux Debian 8.5 Jessie 32 bits
Offline
As stated by the doc, JSONDecode() expects a JSON object, not a JSON array.
Either use
- TDocVariant
- a TSynPersistent class + a T*ObjArray
- a record + a dynamic array
The easiest is TDocVariant.
Offline
Pages: 1