1
10 Comments

how to model data in cloud firestore (NoSql) to allow users to follow a particular category of item

how to structure data to allow users to follow a particular subject or category in cloud firestore

  1. 4

    this is inherently a relational db question.

    Relation queries are better suited to something that uses SQL

    Not that nosql can't do relations, its just not as easy

    speaking as someone whos building a non-trivial app on firebase using firestore... i wouldnt recommend it. you'll quickly hit its limits.

    even pure mongodb is a better solution than firebase. its severely limiting and frustrating.

    just dont.

    1. 2

      You can do relationship with noSQL but its like eating with your feet.

  2. 1

    Is this a question?

    1. 1

      i meant how do i structure data to allow users to follow a particular subject or category in cloud firestore(firebase).

      1. 2

        Ok. Still too little information to give a good answer IMO.

        What is a subject/category? How many collections do you have in firestore?

        1. 2

          ok so i have users collection, books collection and Categories collection. Now i need users to subscribe to a particular category which is a specific document under the Category and therefore the users only sees books related to that specific category. Do you get me?

          1. 1

            Ok I think I get you.

            So I'm not a real expert, but I think Firestore is different to many other options, in that you'd just store the applicable categories as a value of each document in the books collection.

            You can use the Categories collection as the definitive list of available categories for the user to choose from, if necessary.

            That's probably how I'd start off, given the information you've supplied!

            1. 1

              thanks Louis ...

          2. 1

            This comment was deleted 7 years ago

            1. 1

              i really appreciate this thanks ....very intuitive

          3. 1

            This comment was deleted 7 years ago

            1. 1

              Alright thanks bro