Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/476.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在AWS中复制Firestore工作流_Javascript_Angular_Amazon Web Services_Google Cloud Firestore - Fatal编程技术网

Javascript 在AWS中复制Firestore工作流

Javascript 在AWS中复制Firestore工作流,javascript,angular,amazon-web-services,google-cloud-firestore,Javascript,Angular,Amazon Web Services,Google Cloud Firestore,我做了一个简单的Firestore支持的Angular应用程序的概念验证。然而,我的公司处于AWS生态系统中。如果我们只是在AWS中存储json对象的集合,是否有与下面类似的rx工作流 以下是我在Firestore必须做的基本工作: public get mentors(): Observable<Participant[]> { return this._mentors.valueChanges(); } public get mentorEntries():

我做了一个简单的Firestore支持的Angular应用程序的概念验证。然而,我的公司处于AWS生态系统中。如果我们只是在AWS中存储json对象的集合,是否有与下面类似的rx工作流

以下是我在Firestore必须做的基本工作:

  public get mentors(): Observable<Participant[]> {
    return this._mentors.valueChanges();
  }

  public get mentorEntries(): Observable<DocumentChangeAction<Participant>[]> {
    return this._mentors.snapshotChanges();
  }
  constructor(
    private firestore: AngularFirestore) {

      this._mentors = this.firestore.collection('mentors');
  }

  public addMentor(mentor: Participant): Promise<DocumentReference> {
    return this._mentors.add(mentor);
  }
对于我的需求,Firestore rx的简单性是完美的。阅读Amplify文档,我看到了很多承诺,我需要手动跟踪更改吗?AWS是否有类似的rx结构

  mentors$: Observable<Participant[]>;

  constructor(private participantService: ParticipantService) {
    this.mentors$ = participantService.mentors;
  }
  onSubmit() {
    if (this.existingDocument) {
      this.existingDocument.payload.doc.ref.update(this.registerForm.value)
        .then(this.handleFulfilled, this.handleRejected);
    } else {
      this.participantService.addMentor(this.registerForm.value)
        .then(this.handleFulfilled, this.handleRejected);
    }
  }