Firestore: Add Custom Object to db

前端 未结 8 2019
庸人自扰
庸人自扰 2020-12-15 05:31

Good Morning,

I tried adding a new created object from this class:

export class Sponsor implements ISponsor {

  title: string;    
  description?: s         


        
8条回答
  •  Happy的楠姐
    2020-12-15 06:02

    I was having a similar problem using vue and nuxt

    firebase.firestore().collection('example')
       .doc()
       .set({
           'foo' : 'boo'
       })
    

    Error:

    Data must be an object, but it was: a custom Object object
    

    This link helped me

提交回复
热议问题