检查子级是否导致可伸缩性差? [英] Checking for child causes poor scalability?

查看:66
本文介绍了检查子级是否导致可伸缩性差?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这不是一个必须有解决方案"的问题,但是我想知道,如果将代码扩展得更大,此代码是否会引起内存问题.

This isn't a question that nessacarily has a 'solution', but I was wondering if this code would cause memory issues when scaled much larger.

        ref.child("Teams").observeSingleEvent(of: .value, with: { (snapshot) in
            if snapshot.hasChild(self.teamName.text!){
                //Sets the a single team's values
            } else {
                //Displays a missing team alert
                let alert = UIAlertController(title: "Error" , message: "Team does not exist", preferredStyle: .alert)
                let actio1n = UIAlertAction(title: "Ok" , style: .cancel , handler: nil)
                alert.addAction(actio1n)
                self.present(alert, animated: true, completion: nil)
            }
        })

我有点想知道Firebase是否会加载表面水平(每个团队的ID),或者是否会加载更深的深度.你有什么想法?

I'm sort of wondering if Firebase would just load the surface level (each individual team's ID), or if it would load more in-depth. What are your thoughts?

推荐答案

Firebase将获取Teams下的FULL树. 此处:

Firebase will fetch the FULL tree under Teams. More details here:

[...]在数据库中某个位置获取数据时,您还将检索其所有子节点[...]

[...] when you fetch data at a location in your database, you also retrieve all of its child nodes [...]

这篇关于检查子级是否导致可伸缩性差?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆