0

I'm planning to build my own app. It's a home service App to link users with other providers.
I'm recently used a NoSQL database, Firebase, and I am stuck with the design of the database for my app. The question is how to structure the databases in this way with NoSQL, like a JSON tree?

Like

{
"uID":"01",
"username":"John",
"Booking":[{
       "Bid":"01",
       "BDetails":"Cleaner Rooms",
       "Baddress":"America",
        "providerID":"023",
        "timestamp":"1-Mar-2019"
       ....
       ....
      }]
}

Is that right?

0

your database should look something like this object:

{
  users : { uid, ... },
  bookings: { id, uid, ... },
}

And you access each user's bookings by querying with a condition that the column uid matches the user's id, by using firebase.auth().currentUser if you're using firebase. btw you should Cloud Firestore for better scalability and faster queries.

| improve this answer | |
  • Great, actually, I'm use real-time DB, is that good? – DevAS Mar 1 '19 at 16:37
  • Yes but I prefer firebase just because it takes care of everything in the background, no need to worry about servers and what not, it's also got some pretty handy features, especially when it comes to saving images, you should take a look. – mohshbool Mar 1 '19 at 22:13
  • you mean firestore right? – DevAS Mar 2 '19 at 13:35
  • Yes, firebase offers services such as cloud firestore, file storage, analytics and much more! its very useful – mohshbool Mar 3 '19 at 19:04
  • or check here stackoverflow.com/questions/54972993/… – DevAS Mar 3 '19 at 20:33

Not the answer you're looking for? Browse other questions tagged or ask your own question.