首页 > 解决方案 > Firebase .index关于它是如何工作的?

问题描述

例如,如果我有:

users: {
    userId1: {
        email: "email1"
    },
    userId2: {
        email: "email2"
    }
}

如果我想弄清楚我想添加到我的用户树中的某个新电子邮件是否存在。我希望复杂性与用户树中的数据量成线性关系。像 O(n)?

如果我有规则:

"users": {
    ".indexOn": ["email"]
}

Firebase 到底在做什么?它会变成像 O(1) 这样的东西吗?

标签: firebasefirebase-realtime-databasefirebase-security

解决方案


推荐阅读