fireorm
fireorm copied to clipboard
RFC: Turn subcollection initialisation off for certain queries?
I've come across certain queries that I would like to omit sub-collections from (the data is being ingested by a third party and essentially I need the document data, not a FireORM instance).
Would there be any value in turning this off in a per-request config? I was thinking something like this:
getRepository(Product).findById('1234', { initializeSubcollections: false });
This would of course be optional and true by default!
It does seem a little hacky to me, but it beats the alternative of removing the subcollections via destructuring.
Sorry it took me that much time to reply!
Yes, that seems to be a good idea. Maybe have a toggle to disable subcollection initialization on a project basis (setting something in the initialize) and maybe per query as you suggested.