Is it possible to have references to an object elsewhere in the Firebase database? Here's an example:
{
"articles": {
"-article1": {
"title": "Article 1",
"category": "Other",
"owner": root.users['-user1']
},
"-article2": {
"title": "Article 2",
"category": "Other",
"owner": root.users['-user2'].value
}
},
"users": {
"-user1": {
"name": "User 1",
"articles": {
"-article1": root.articles['-article1'].value
}
},
"-user2": {
"name": "User 2",
"articles": {
"-article2": root.articles['-article2'].value
}
}
}
}
This way is should make querying a lot easier as I wouldn't need to first make a query to the article itself, and then get the user info from "users" path. However, doing it like above would generate an endless loop of article->owner->article->owner and so on... Unless, Firebase would see this and instead set a repeated value into null.
Anyways, is this even possible?
Thanks in advance!