是否可以在不知道它属于哪个集合的情况下通过键查询 Firestore 中的元素?

Is it possible to query an element in Firestore by key without knowing which collection it belongs to?

使用 AngularFire2、Angular、Firebase Firestore 和我的一个记录来模拟用户与不同类型对象之间的关系。

/*
Represents a reaction that a user has towards some object in the system.
*/
export interface Reaction{

// The id of the user making that reaction
userId? : string;

// The id of the object that is being reacted to. Place, Org, List, Offer
objectId? : string;

}

如您所见,唯一存储的是对象的键,而不是它的类型或它属于哪个集合。我想知道以后怎么可能查询反应,然后从那里完全基于它们的键获取对象?

您必须知道文档集合(可能还有子集合)的名称才能获取它。在不知道集合的情况下,没有可以获取文档的查询概念。