我有這部分代碼來獲取集合 firebase
const db = getFirestore(app)
const getCollection = name => collection(db, name)
const collection = getCollection(db, 'chars')
const query = await collection.where('name', '==', value)
我得到的錯誤.where不是函式,有什么問題?
未處理的拒絕(TypeError):collection.where 不是函式
uj5u.com熱心網友回復:
您正在使用新的模塊化 SDK,其中所有功能都是頂級的。
要創建查詢,請執行以下操作:
const query = query(collection, where('name', '==', value))
另請參閱有關構建查詢的 Firebase 檔案。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/349401.html
上一篇:在Firebase中選擇分析位置
