Skip to content
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

UnhandledPromiseRejectionWarning: TypeError: documentRef.getCollections is not a function #606

Closed
congpc opened this issue Jul 29, 2019 · 5 comments
Assignees

Comments

@congpc
Copy link

congpc commented Jul 29, 2019

[READ] Step 1: Are you in the right place?

  • For issues or feature requests related to the code in this repository
    file a Github issue.
    • If this is a feature request make sure the issue title starts with "FR:".
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Operating System version: MacOS 10.14.5
  • Firebase SDK version: 7.2.1
  • Library version: firebase-tools v'7.2.1' & firebase-admin v'8.3.0' & firebase-functions v'3.2.0'
  • Firebase Product: admin & firestore (auth, database, storage, etc)

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

  • I was used firebase-tools v'7.0.0' & firebase-admin v'7.0.0' & firebase-functions v'2.3.0', then can use method 'getCollections' of DocumentReference.

  • But I was upgrade version firebase-tools v'7.2.1' & firebase-admin v'8.3.0' & firebase-functions v'3.2.0', then I can't use this method and occur this error.

Did you deprecated this method or not? I still see The documentation at here for this method 'https://firebase.google.com/docs/firestore/query-data/get-data#list_subcollections_of_a_document'

Relevant Code:

await documentRef.getCollections()
@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@congpc congpc changed the title UnhandledPromiseRejectionWarning: TypeError: ref.getCollections is not a function UnhandledPromiseRejectionWarning: TypeError: documentRef.getCollections is not a function Jul 29, 2019
@congpc
Copy link
Author

congpc commented Jul 29, 2019

Oh, I saw you was changed method name 'listCollections', but you don't mention this method is deprecated :(, Ref: (https://googleapis.dev/nodejs/firestore/latest/DocumentReference.html#listCollections)

@hiranya911
Copy link
Contributor

This is one of the breaking changes that went out with Firestore 2.0.0 and Admin 8.0.0. But the documentation still shows the old method it seems. @schmidt-sebastian FYA.

@schmidt-sebastian
Copy link
Contributor

It looks like we forgot to update our docs. Thanks for catching that!

@samtstern Can you update the code snippets on https://firebase.google.com/docs/firestore/query-data/get-data#list_subcollections_of_a_document to use listCollections() for Java and Node?

getCollections was deprecated as of v0.18.0.

@hiranya911
Copy link
Contributor

I've created an internal bug to track the documentation update. Closing this since there's no action items for this repo.

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

No branches or pull requests

5 participants