concat()
Description
The concat()
method creates an Set by copying the calling
set to a new set and appending otherSet.
the calling set and otherSet aren’t changed.
Examples
This example concatenates two sets:
-
List the first set:
{ data: [ { id: "386968888557961284", coll: Store, ts: Time("2024-01-15T06:45:40.390Z"), name: "DC Fruits", address: { street: "13 Pierstorff Drive", city: "Washington", state: "DC", zipCode: "20220" } }, { id: "386968888560058436", coll: Store, ts: Time("2024-01-15T06:45:40.390Z"), name: "Foggy Bottom Market", address: { street: "4 Florida Ave", city: "Washington", state: "DC", zipCode: "20037" } } ] }
-
List the second set:
{ data: [ { id: "386968888587321412", coll: Manager, ts: Time("2024-01-15T06:45:40.390Z"), firstName: "John", lastName: "Bender", address: { street: "2300 Shermer Road", city: "Shermer", state: "IL", zipCode: "60062" }, telephone: "847-576-5711" } ] }
-
Concatenate the two sets:
{ data: [ { id: "386968888557961284", coll: Store, ts: Time("2024-01-15T06:45:40.390Z"), name: "DC Fruits", address: { street: "13 Pierstorff Drive", city: "Washington", state: "DC", zipCode: "20220" } }, { id: "386968888560058436", coll: Store, ts: Time("2024-01-15T06:45:40.390Z"), name: "Foggy Bottom Market", address: { street: "4 Florida Ave", city: "Washington", state: "DC", zipCode: "20037" } }, { id: "386968888587321412", coll: Manager, ts: Time("2024-01-15T06:45:40.390Z"), firstName: "John", lastName: "Bender", address: { street: "2300 Shermer Road", city: "Shermer", state: "IL", zipCode: "60062" }, telephone: "847-576-5711" } ] }
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!