0

I have the next databases: recipes and ingredientes

recipes: {
  "ingredients": {
    "id1": true,
    "id2": true,
    "id3": true
  }
}
ingredients: {
  "id1": {
    "text": "Ingrediente1",
    "quantity": "100g"
  },
  "id2": {
    "text": "Ingrediente2",
    "quantity": "200g"
  },
  "id3": {
    "text": "Ingrediente3",
    "quantity": "300g"
  }
}

When I access to the recipes, I have to "populate" de IDs and return the correct data. Somethig like this:

recipes: {
  "ingredients": {
    "id1": {
      "text": "Ingrediente1",
      "quantity": "100g"
    },
    "id2": {
      "text": "Ingrediente2",
      "quantity": "200g"
    },
    "id3": {
      "text": "Ingrediente3",
      "quantity": "300g"
    }
  }
}

Is it possible? I use angularFire (^4.0.0-rc0), firebase(3.9.0) and ionic 3.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Alberto
  • 13
  • 4
  • That sounds feasible. See for example the answer here: https://stackoverflow.com/questions/38421551/joining-flattened-data, here https://stackoverflow.com/questions/41755579/how-to-get-do-a-join-in-angularfire2-database and probably more from this: https://www.google.com/search?q=Angularfire2+join. If you're having trouble implementing this yourself, show the [minimal complete code that reproduces where you're stuck](http://stackoverflow.com/help/mcve). – Frank van Puffelen Feb 01 '18 at 15:05
  • Thanks for the information! – Alberto Feb 21 '18 at 11:43

0 Answers0