查询大量文档是否会导致读取集合中的所有文档,即使它们不满足条件?
Will a query of a big number of docs cause a read on all the doc in the collection even if they don't meet the condition?
基本上,我想查询可能包含 100 个文档或 200.000 个文档的数据集合。
由于我想在一个查询中定位,假设最多 50 个,这个查询会花费我读取该集合中的文档总数还是只读取满足查询条件的文档?
const q = query(collection(db, 'Data'), where('clientId', '==', id));
基本上,我想查询可能包含 100 个文档或 200.000 个文档的数据集合。 由于我想在一个查询中定位,假设最多 50 个,这个查询会花费我读取该集合中的文档总数还是只读取满足查询条件的文档?
const q = query(collection(db, 'Data'), where('clientId', '==', id));