Firebase Invalid document reference. Document references must have an even number of segments

前端 未结 3 1125
生来不讨喜
生来不讨喜 2021-01-18 05:57

What is wrong with this query?

const db = firebase.firestore()
const query = db.doc(this.props.user.uid).collection(\'statements\').orderBy(\'uploadedOn\',          


        
3条回答
  •  逝去的感伤
    2021-01-18 06:52

    For others having this issue, make sure that no document reference has an empty string.

    I had this issue when using a get method with uid input as below and forgot to check if uid is empty

    private fun getFullRef(uid: String): CollectionReference {
            return ref.document(uid).collection(FireContact.SUB_PATH)
        }
    

提交回复
热议问题