如何检索可变子Firebase数据库管理员的子

时间:2018-09-11 02:31:00

标签: firebase go firebase-realtime-database

我的数据的结构如下:

$forumId:
 topics:
   $topicId:
     creator: string,
     topic: string,
     posts:
        $postId:
           author_id: string,
           time: int,
           content: string

我想获取论坛的最新帖子,但不确定如何。这是查询的一个开始。由于某些子项是变量,我该如何设置查询?

client.NewRef(ForumId).Child("topics").Child("not sure").Child("posts").Child("not sure").OrderByChild("time").LimitToLast(1).GetOrdered(ctx)

0 个答案:

没有答案