我正在嘗試通過 React Native 中的檔案參考進行過濾。我正在使用react-native-firebase. 我想要其欄位 (DocumentReference) 在提供的陣列中的所有檔案:
const subscriber = firestore()
.collection('strategyCounts')
.where(
'strategy',
'in',
user.strategies.map(strategy => {
return strategy.path;
}),
).onSnapshot(...)
user.strategies 看起來像這樣 ["/strategies/id", "/strategy/id2"]



uj5u.com熱心網友回復:
如果要按檔案參考過濾,則需要DocumentReference在陣列中傳遞物件。所以像:
user.strategies.map(strategy => {
return firestore().doc(strategy.path);
}),
或(略短):
user.strategies.map(strategy => firestore().doc(strategy.path)),
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/361212.html
標籤:javascript 火力基地 谷歌云firestore 反应原生火力基地
上一篇:有沒有辦法在djangorest框架中為嵌套關系(嵌套序列化器類)動態指定查詢集
下一篇:檢查一個不存在的類
