The easiest way to explain my situation is the standard file system structure, which is close to what I want to accomplish:
Folder A - Folder A2 -- File 1 -- File 2 - File 3 Folder B - Folder B2 - Folder B3 -- File 4
There are fields in the folder:
- _id - parents (in my case there can actually be multiple!)
The file has fields
- _id - targetFolder
So basically the file can be very deep in the hierarchy.
How to efficiently search and structure my database in order to have deep hierarchies of folders, and any of them has files.
I want to be able to make a request that returns every file, for example. Folder A. How can i do this?
Ahmed source share