Skip to content

modular firestore DocumentSnapshot.exists is property not method contrary to docs #8460

Open
@mikehardy

Description

@mikehardy
  1. In Firebase docs regarding the migration to the modular API, we get this:

The modular API introduces a breaking change in which the property firestore.DocumentSnapshot.exists has been changed to a method.

I did not run into this method during the migration. Types and code seem to still be working as if it is a property.

const unsubscribe = onSnapshot(docRef, (docSnapshot) => {
  if (docSnapshot.exists) {} // I was able to keep this
  console.log(typeof docSnapshot.exists); // Logs boolean
});

Originally posted by @cbdeveloper in #8282

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