How to fetch include the concatenation of a list of strings?

#1

Let’s say that the following is one instance of an entity type

{
  "id": "A",
  "owns": ["apple", "house", "car"]
}

Can I do a fetch to get the following?

{
  "id": "A",
  "concat(owns)": "applehousecar"
}

Something like

MyType.fetch(spec = {"include": "concat(owns)"})

?

In the end, I would like

MyType.fetch(spec = {"filter": "contains(concat(owns), 'apple')"})
0 Likes

#2

Does MyType.fetch(spec = {"filter": "contains(owns, 'apple')"}) not work?
MyType.fetch(spec = {"filter": "intersects(owns, ['apple'])"}) should also work.

1 Like

#3

Yes! Amazing! (Typing more because it needs at least 20 characters…)

1 Like