Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
boblepepeur opened this issue May 25, 2023 · 1 comment
Closed

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

boblepepeur opened this issue May 25, 2023 · 1 comment
Labels

Comments

@boblepepeur
Copy link

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?

@exaby73
Copy link
Contributor

exaby73 commented Nov 7, 2023

Hello @boblepepeur. This issue seems to be fixed in the latest version. Closing this issue for the same reason, If you disagree with my decision, please comment and I'll reopen it. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants