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

Firebase 是否可以在不知道Firestore中的元素属于哪个集合的情况下按键查询该元素?,firebase,angularfire2,google-cloud-firestore,Firebase,Angularfire2,Google Cloud Firestore,使用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

使用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;

}

正如您所看到的,存储的唯一内容是对象的键,而不是对象的类型或它所属的集合。我想知道以后怎么可能查询这些反应,然后从中完全根据它们的键获取对象?

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

Oh ok。。。谢谢,道格。您知道这些密钥是普遍唯一的还是仅在它们自己的集合中唯一?它们在集合中是唯一的。您可以将集合视为文档唯一路径的一部分:
collection1/doc1/subcollection1/doc1