我想从 Firestore 中检索单个文档。所以我不是指集合中的文档列表(我知道该怎么做)。假设我知道文档的一个键值对,我想在 Angular 4 中找到并检索文档。
interface Occupations {
duration: number;
id_entity: number;
id_job: number;
id_user: number;
salary: number;
start_time: number;
}
occupationDoc:AngularFirestoreDocument<Occupations>;
occupation: Observable<Occupations>;
<h1>A specific post:</h1>
<h3>{{ (occupation | async)?.salary }}</h3>
<p>{{ (occupation | async)?.id_user }}</p>
<p>{{ (occupation | async)?.duration }}</p>
<p>{{ (user | async)?.lastName }}</p>