非常感谢任何帮助。非常感谢你的时间。
让我们说,Articles
节点下有一大堆文章。
"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"
}
这些文章由一些作者发表。注册用户可以浏览文章,并喜欢它们。受欢迎的articles keys
存储在Users
节点下的favArticles
个人资料中。由于该文章包含大量数据,因此只有文章的key
和name
存储在User
个人资料下。
"Users" : {
"ZtlIQ2d1qJT1XpmHuGxwFSwaiEy2" : {
"emailId" : "vs@gmail.com",
"favArticles" : {
"article1Key" : {
"name" : "article1"
},
"article7Key" : {
"name" : "article7"
},
"article4Key" : {
"name" : "article4"
}
},
"firstName" : "Vimala",
"image" : "default",
"lastName" : "Sridhar"
}
}
让我们说用户已经喜欢了1000篇文章中的约50篇。现在,如果我想在RecyclerView中显示用户喜欢的文章,我应该如何编写查询以从文章列表中选择特定文章?