Any help is much appreciated. Thank you so much for your time.
Let us say, there is a large set of articles under Articles
node.
"Articles" : {
"article1Key" : {
"articleAuthor" : "Author",
"articleFavByNo" : 21,
"articleKey" : "Key",
"articleName" : "Name",
"articlePostedOn" : "21/07/11",
"articleTopic" : "Topic"
},
"article2Key" : {
"articleAuthor" : "Author",
"articleFavByNo" : 21,
"articleKey" : "Key",
"articleName" : "Name",
"articlePostedOn" : "21/07/11",
"articleTopic" : "Topic"
},
...
"article10Key" : {
"articleAuthor" : "Author",
"articleFavByNo" : 21,
"articleKey" : "Key",
"articleName" : "Name",
"articlePostedOn" : "21/07/11",
"articleTopic" : "Topic"
}
The articles are posted by some authors. Registered user can browse through the articles, and like them. The liked articles keys
are stored in Users
profile under favArticles
node. Since, the article contains huge amount of data under it, only the key
and name
of the article is stored under User
profile.
"Users" : {
"ZtlIQ2d1qJT1XpmHuGxwFSwaiEy2" : {
"emailId" : "vs@gmail.com",
"favArticles" : {
"article1Key" : {
"name" : "article1"
},
"article7Key" : {
"name" : "article7"
},
"article4Key" : {
"name" : "article4"
}
},
"firstName" : "Vimala",
"image" : "default",
"lastName" : "Sridhar"
}
}
Let us say that the user has liked some 50 articles out of 1000. Now if I want to display the User favorite articles in a RecyclerView, how should I write my query to pick the specific articles from the article list?