2017-12-27 12 views
1

私は画像に見られるようにjobsPostedというフィールドを持っていますので、私は別のジョブを追加したい、私はすでに食器洗い機とウェイターを持っています。しかし、私は次に使用Firestoreにフィールドを追加しますか?

jobsPosted = {} 

    var postJobObject = { 
      "position": this.state.selected, 
      "timeSchedule": this.state.timeSchedule, 
      "compensation" : this.state.compensation, 
      "experience" : this.state.experience, 
      "description" : this.state.description 
     } 

jobsPosted['newJob'] = postJobObject; 

を試してみて、私のpostJobbject

var postJobObject = { 
     "position": this.state.selected, 
     "timeSchedule": this.state.timeSchedule, 
     "compensation" : this.state.compensation, 
     "experience" : this.state.experience, 
     "description" : this.state.description 
    } 

Here is a link to an image of my firestore

+0

あなたが得るエラーは何ですか? –

+0

db.collection( "companies")。doc( "Tiradito")。フィールドは関数ではありません – bility

答えて

0

だこのクエリ

 db.collection("companies").doc("Tiradito").field("jobsPosted").set(postJobObject).then(function() { 
     console.log("Document successfully written!"); 
     }); 

でエラーが発生しますupdate

db.collection("companies").doc("Tiradito").update(jobsPosted).then(function() { 
     console.log("Document successfully written!"); 
     }); 
関連する問題