Skip to content

DataSnapshot.exists(): boolean when value is 0 #1407

@boblepepeur

Description

@boblepepeur

Related issues

[REQUIRED] Version info

node:

v20.1.0

firebase-functions:
"firebase-functions": "^4.4.0",

firebase-tools:

firebase-admin:
"firebase-admin": "^11.5.0",

[REQUIRED] Test case

In firebase, create a node with value 0, lesson change with onWrite, if (change.after.exists()) is false

[REQUIRED] Steps to reproduce

exports.OnValueWrite = functions.database.ref('/currentCheckPointPosition').onWrite(async (change, context) => {
    logger.debug(change.after.exists(), change.after.val())
});
  • Create value currentCheckPointPosition setted to 0
  • result of log is false 0

[REQUIRED] Expected behavior

  • log need to be true 0

[REQUIRED] Actual behavior

Were you able to successfully deploy your functions?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions