Firestore - Get document collections

后端 未结 5 2065
谎友^
谎友^ 2020-12-28 21:32

i would to automate backup process of a firestore database. The idea is to loop over root document to build a JSON tree. but i didn\'t find a way to get all collections ava

5条回答
  •  梦毁少年i
    2020-12-28 22:13

    If you are using the Node.js server SDK you can use the getCollections() method on DocumentReference: https://cloud.google.com/nodejs/docs/reference/firestore/0.8.x/DocumentReference#getCollections

    This method will return a promise for an array of CollectionReference objects which you can use to access the documents within the collections.

提交回复
热议问题