【问题标题】:Convert SQL query to Cloud Firestore on Android development在 Android 开发中将 SQL 查询转换为 Cloud Firestore
【发布时间】:2018-11-02 03:52:43
【问题描述】:

如何将 SELECT USERID FROM CUSTOMER WHERE NAME = "JOHN" 转换为 Android 上的 Cloud Firestore?

【问题讨论】:

    标签: java android firebase google-cloud-firestore


    【解决方案1】:

    为此,请使用以下代码行:

    FirebaseFirestore rootRef = FirebaseFirestore.getInstance();
    CollectionReference customerRef = rootRef.collection("Customer");
    Query query = customerRef.whereEqualTo("name", "John");
    

    【讨论】:

    • 能不能拿到身份证?像 7E6ID...?
    • 如果您使用get() 呼叫,是的,然后您应该使用:document.getId()
    • 很高兴听到这个消息。干杯!
    猜你喜欢
    • 1970-01-01
    • 2021-08-24
    • 1970-01-01
    • 2020-01-16
    • 2014-08-14
    • 2015-10-10
    • 2015-05-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多