square brackets have a specific meaning in query by attribute
see Example 5
or
Linking array attribute query arguments (16R2 and later)
https://doc.4d.com/4Dv17/4D/17.1/QUERY-BY-ATTRIBUTE.301-4178904.en.html
> 2019/04/27 2:01、Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com>のメール:
>
> $queryString
Hi Kirk,
in your example it should work like:
$obj:=New object("id";"some string";"fields";New collection(New
object("i";0;"name";"value1");New object("i";1;"name";"value2");New
object("i";1;"name";"value3")))
$selection:=$obj.fields.query("(i == 1) && (name == :1)";"value2")
--
Grüße/Regar
Kirk,
You might try .find() or .findIndex() for that kind of thing.
I've only used .query() directly on attributes (field names) in entity
selections so far.
Jim
On Fri, Apr 26, 2019 at 1:01 PM Kirk Brooks via 4D_Tech <
4d_tech@lists.4d.com> wrote:
> Imagine a collection or entity selection pop
Imagine a collection or entity selection populated with objects like:
{
id: "some string",
fields: [
{i:0, name:value1},
{i:1, name:value2},
{i:2, name:value3},
...
]
}
I want to find collection elements by searching for 'fields[1].name' =
someValue.
That is, only matches on the second e
4 matches
Mail list logo