Android 从Firestore中检索null对象,而实际上它不是null

Android 从Firestore中检索null对象,而实际上它不是null,android,node.js,google-cloud-firestore,google-cloud-functions,Android,Node.js,Google Cloud Firestore,Google Cloud Functions,我一直在试图理解为什么我的查询从服务器生成的时间戳值返回null对象 基本上,我在Firestore数据库上使用了onUpdate()触发器,检查产品是否缺货,并在库存时发出提醒,您需要为所有字段包含默认空构造函数和getter。如果只有时间戳为空,则不能为时间戳设置getter。是否为每个属性(包括时间戳)设置getter?对于自定义类,使用默认的空构造函数 const date = admin.firestore.FieldValue.serverTimestamp(); c

我一直在试图理解为什么我的查询从服务器生成的时间戳值返回null对象


基本上,我在Firestore数据库上使用了onUpdate()触发器,检查产品是否缺货,并在库存时发出提醒,您需要为所有字段包含默认空构造函数和getter。如果只有时间戳为空,则不能为时间戳设置getter。

是否为每个属性(包括时间戳)设置getter?对于自定义类,使用默认的空构造函数
    const date = admin.firestore.FieldValue.serverTimestamp();
    const reminder = {
      productID : product.barcode,
      date : date,
      status: 'Order'
  }

      const docSnapShot = admin.firestore().collection('reminders').doc(product.barcode).get().then(documentSnapShot =>{
          if(documentSnapShot.exists){
            return admin.firestore().collection('reminders').doc(product.barcode).update({date: date}).then(res=> {
              console.log('Document updated');
              return null;
            }).catch(error =>{
              console.log('Error',error);
              return null;
            });
          }
          else{
            exists = docSnapShot.exists;
            return null;
          }
      });
public reminderFirestore(Timestamp date, String productID, String status) {
    this.productID = productID;
    this.date = date;
    this.status = status;
}