2017-12-27 1 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

012 3,
관련 문제