0

当我尝试读取文档数据时,我不断收到以下错误。奇怪的是我可以读取documentID,也可以写入firestore。以下是我读取数据的方式:

async fetchUserDetailByID(context, userID) {
            try{
                let tmp = {};
                await userRef.doc(userID).get().then((doc)=> {
                    console.log(doc.data())
                });
                return tmp
            }catch (e) {
                console.log(e);
            }
        }

以下是我得到的错误:

FirebaseError:函数 GeoPoint() 要求其第一个参数的类型为数字,但它是:未定义

PS:我的firestore规则允许任何人读写

4

1 回答 1

0

I just noticed the issue cause of the issue.

It seems Firestore does not support 0 as a latitude or longitude as it's geopoint data type. enter image description here When I changed the values of the user location, the query now works normally

于 2020-04-08T13:52:42.327 回答