#1 Re: mORMot 2 » Help for uses IDocList » 2024-11-18 10:06:08

thanks for everyone
all works after change IDocList to IDocDict

#2 Re: mORMot 2 » Help for uses IDocList » 2024-11-18 07:45:11

/// access one element in the list, as IDocList (List)
// - warning: weak reference to the main list, unless you explicitly Copy it
property L[position: integer]: IDocList
   read GetL write SetL;

what means "position" in this context?

#3 Re: mORMot 2 » Help for uses IDocList » 2024-11-18 07:38:02

I use delphi XE, mORMot 2.3 stable
and get compiler error "[DCC Error] TestApp_FMain.pas(1645): E2010 Incompatible types: 'Integer' and 'string'

for d1 in DocList(json) do
    for d2 in d1.L['phones'] do // Exception is here
      writeln(d2['number']);

#4 mORMot 2 » Help for uses IDocList » 2024-11-16 09:46:45

vetal71
Replies: 6

Hello
I need help.
I have the next json

[
    {
        "id": "f7518487-6e95-4c90-8438-a6b48d6a8b5f",
        "name": "user",
        "phones": [
			{
				"type": "mobile"
				"number": "123-456-789"
			}
			
		]
    }
]

I need to get the value of nested array phones[0].number
How can i do this via IDocList?

PS. Sorry for my English

Board footer

Powered by FluxBB