0

I have an Events collection with these fields:

name: "Event 1",
description: "Description 1",
tags: [1, 4]

And in the Tags collection:

id: 1,
name: "Party Hard",
color: "red"

How can I concat these 2 collections and return something like this?

name: "Event 1",
description: "Description 1",
tags: [{
  name: "Party Hard",
  color: "red"
}, {
  name: "Open bar",
  color: "blue"
}]
Maicon Furtado
  • 298
  • 1
  • 4
  • 15
  • 1
    If you're asking if Firestore can do the equivelant of a SQL joins that combine documents between collections, the answer is no. You have to query each collection separately and combine the results in your app. – Doug Stevenson Apr 17 '23 at 00:50
  • If what Doug wants is indeed what you're trying to do, also have a look at: https://stackoverflow.com/questions/65641342/combine-two-different-collections-of-firebase-in-flutter – Frank van Puffelen Apr 17 '23 at 01:19
  • Thanks, guys! I got it like this: https://i.ibb.co/HG62cRp/Captura-de-Tela-2023-04-16-a-s-22-27-02.png – Maicon Furtado Apr 17 '23 at 01:28
  • @MaiconFurtado Can you post your solved issue as an answer so the other community members will also get help from that ? – Rohit Kharche Apr 17 '23 at 08:00

0 Answers0