如何在一次往返中獲得多個ID的文檔?我想知道是否有可能在一個往返過程(網絡調用)中通過ID列表獲得多個文檔。
3 回答

皈依舞
TA貢獻1851條經驗 獲得超3個贊
function getById (path, ids) { return firestore.getAll( [].concat(ids).map(id => firestore.doc(`${path}/${id}`)) ) }
getById('collection', 'some_id')
getById('collection', ['some_id', 'some_other_id'])
添加回答
舉報
0/150
提交
取消