fixiversity / tracking

Central issue repository for fixiversity
1 stars 0 forks source link

Document references cannot be sub-queried, impacting user functionality #4

Open v-pan opened 5 years ago

v-pan commented 5 years ago

Short summary

As document references cannot currently be "sub-queried", this makes having user functionality with only a client and database slow.

Background

Users who have upvoted or have authored a post are stored in the Firestore with a document reference. From this post from 2017, it would seem that the functionality to query these references is still not included, and is not likely to be included soon.

To accomplish this in our current system, Google generally recommends duplicating the data, but this would require updating all instances of an object individually by some server-side function. Another solution would be fetching every document reference and querying for them, which would slow down queries on documents with many upvotes, etc. and would most likely also be done server-side.

This means the only current workarounds for this issue would be a server-side function implementation, which is currently not possible with only a client and database, or slowing down the client an unreasonable amount.

Todo

Acceptance criteria

Data can be queried in some form from the Firestore, or sub-querying is made irrelevant.