【发布时间】:2021-11-22 21:36:30
【问题描述】:
数据结构:
Posts ( collection )
⤷ Post_1 ( document )
⤷ post_id ( field )
⤷ post_description ( field )
⤷ category ( value = category_1 ) ( field )
⤷ Post_2 ( document )
⤷ post_id ( field )
⤷ post_description ( field )
⤷ category ( value = category_1 ) ( field )
⤷ Post_3 ( document )
⤷ post_id ( field )
⤷ post_description ( field )
⤷ category ( value = category_1 ) ( field )
⤷ Post_4 ( document )
⤷ post_id ( field )
⤷ post_description ( field )
⤷ category ( value = category_2 ) ( field )
⤷ Post_5 ( document )
⤷ post_id ( field )
⤷ post_description ( field )
⤷ category ( value = category_1 ) ( field )
⤷ Post_100 ( document )
⤷ post_id ( field )
⤷ post_description ( field )
⤷ category ( value = category_1 ) ( field )
⤷ Post_1000 ( document )
⤷ post_id ( field )
⤷ post_description ( field )
⤷ category ( value = category_2 ) ( field )
⤷ Post_5000 ( document )
⤷ post_id ( field )
⤷ post_description ( field )
⤷ category ( value = category_1 ) ( field )
⤷ Post_10000 ( document )
⤷ post_id ( field )
⤷ post_description ( field )
⤷ category ( value = category_2 ) ( field )
⤷ Post_15000 ( document )
⤷ post_id ( field )
⤷ post_description ( field )
⤷ category ( value = category_2 ) ( field )
⤷ Post_20000 ( document )
⤷ post_id ( field )
⤷ post_description ( field )
⤷ category ( value = category_2 ) ( field )
⤷ Post_25000 ( document )
⤷ post_id ( field )
⤷ post_description ( field )
⤷ category ( value = category_1 ) ( field )
⤷ Post_50000 ( document )
⤷ post_id ( field )
⤷ post_description ( field )
⤷ category ( value = category_2 ) ( field )
问题1:假设用户发布了一个新帖子(帖子是post_45813),然后决定更新帖子描述,这种情况下的阅读量是如何计算的,会是多少?
问题2:如果我想从post_20000到post_20100获取文档而不考虑类别名称,这种情况下的read是如何计算的,会是多少?
问题 3:如果我想获取类别 1 内的所有文档,假设类别 1 内有 13833 个帖子,这种情况下阅读量是如何计算的,会是多少?
【问题讨论】:
标签: firebase google-cloud-platform google-cloud-firestore