Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
Relational data in Firestore + Node.js

I'm trying to create a recipe backend to test firestore and so far I've managed to get the CRUD operations working for the users, authentication & hashing passwords. Now I wanted to make it so there are two tables: ingredients and recipes and was wondering the best way to go about this?

My plan:

  1. Make ingredients with all the apples, pears, rice, etc. and fill up the table as usual.
  2. Make recipes with an ingredients array that just points to the ingredientId of each of the ingredients. (one to many)
  3. Make it so the users can place a single review on the recipe (one to many)

I've done something similar in MongoDb before but I can't find anything written about firestore + Node.js on this. For reference, in MongoDb I would do something like this for the `reviews:

  review: {
    type: mongoose.Schema.ObjectId,
    ref: 'Recipe',
    required: [true, 'Review must belong to a Recipe!']
  },

My idea is that I structure it like:

Recipe: {
   name: 'Yummy Cake',
   cooking time: '15 mins',
   ... other fields,
   ingredients: [
       { ingredientId1: '5',
         ingredientId2: '25',
         ...
       }
     ],
   reviews: [
      { userId1: '4',
        userId2: '3',
      }
    ]
  }
      

But I don't really know how to write that in a firestore-friendly manner. Any help is greatly appreciated! Also I'm using firebase-admin as the package.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!