samuelgozi/firebase-firestore-lite

Cannot update timestamp field when passed Date

Closed this issue · 3 comments

Thank you for taking time out of your busy schedule!
I love this library.

I'm trying to update a document with the following code.

db.ref('users/user-id-1').update({ name: 'username', birthday: new Date(2000, 7, 7) })

But, I cannot not update birthday field (type is timestamp).

Following is the request payload.

{
  "writes": [
    {
      "update": {
        "fields": {
          "name": { "stringValue": "username" },
          "birthday": { "timestampValue": "2021-08-07T00:00:00.000Z" }
        },
        "name": "projects/***"
      },
      "currentDocument": { "exists": true },
      "updateMask": { "fieldPaths": ["name"] }
    }
  ]
}

updateMask.fieldPaths does not include birthday.

Thank you for opening the issue. Im taking a look at this now.

This is fixed in 1.0.3.
Please let me know if there are any other issues, or if the issue persists.

Thank you for the quick fix 🙇