SkynetLabs / skynet-accounts

Other
8 stars 5 forks source link

Improve UploaderInfo with some JOINs #185

Open ro-tex opened 2 years ago

ro-tex commented 2 years ago

f/u

Definitely not a requirement for this PR but I wonder if PJ could turn this into some fancy query which fetches all uploads for a skylink id and then joins them with their users where possible. So that all of that happens with a single query.

_Originally posted by @ChrisSchinnerl in https://github.com/SkynetLabs/skynet-accounts/pull/182#discussion_r842202273_

f/u Might be a tiny bit more efficient to use a map to pointers to avoid this dereference here. Because the ID, Email, Sub and StripeID are later copied again anyway.

ro-tex commented 2 years ago

https://www.mongodb.com/docs/manual/reference/operator/aggregation/lookup/ https://hevodata.com/learn/mongodb-joins/