Firebase-js-sdk: FR: get doc of sub-collections at once

Created on 18 Mar 2018  路  1Comment  路  Source: firebase/firebase-js-sdk

[REQUIRED] Describe your environment

  • Operating System version: JS
  • Firebase SDK version: 4.11
  • Firebase Product: firestore

[REQUIRED] Describe the problem

if we have some data like;

  • collection-department

    • dept1

      • collection-employee



        • emp2


        • emp1



    • dept2

      • collection-employee



        • emp5


        • emp8



    • dept3

      • collection-employee



        • emp6


        • emp10



  • another-collection

if we want the employees in dept1
db.collection('/collection-department/dept1/collection-employee').get()

we need to get all employees in all department in one request; something like
db.collection('/collection-department/*/collection-employee').get()

my case is efferent but this sample for explanation.. that we cant USE the sub collection feature if we miss this option.. our scenario have a thousand of document that share the same sub-collection and we need to get the data in single request not doing a thousands one...

Thanks

firestore feature request

Most helpful comment

Thanks for the feedback @mohshraim. This type of query is definitely on our roadmap, but unfortunately I don't have any ETA for when it'll be available. I totally agree that we need this to make subcollections fully useful though!

>All comments

Thanks for the feedback @mohshraim. This type of query is definitely on our roadmap, but unfortunately I don't have any ETA for when it'll be available. I totally agree that we need this to make subcollections fully useful though!

Was this page helpful?
0 / 5 - 0 ratings