This is the first time I'm developing an application in Firebase, and I was curious how I should simulate data between two objects, userand a post. I come from a more relational background db, and I was curious not only how it would be done in non-relational databases, but also specifically how to establish a connection between two objects in Firebase.
For example, in my application there are many users, and each user creates many messages.
User {
firstName: String,
lastname: String,
userName: String
}
Post {
title: String,
content: String,
date: Date,
writtenBy: [User object?]
}
How should I structure these two objects in Firebase so that Post belongs to the User, but all messages can be requested independently of the user, and both User and Post objects can be edited without violating other object data and / or relationships?
"" firebase:
sync.$set({userA: {
firstname: "Billy",
lastName: "Bob",
userName: "BillyBob",
Posts: {
}
}
});
!