Set the correct path for files in nested folders tree

Hi Community ,
As of now I am able to create tree structure for the folders and the files . I able to add files into each folders those having specific folders reference.
you can check what I have done in the below link : Mongo playground

Now for each file I have to set proper path.
Imagine the folder structure like below and also you can check in my mongo play ground too
-Folder3 - nature.jpg

Now what I need is , in my files I have path where it is like files/nature.jpg but I need exact path like files/Folder1/Folder2/Folder3/nature.jpg
Note: you can find the path in files → metadata-> path

Can some one please help me in this .
Thanks in advance.