mongoose-mpath icon indicating copy to clipboard operation
mongoose-mpath copied to clipboard

Path update

Open mfazeliLNC opened this issue 1 year ago • 3 comments

Hi, thanks for the nice plugin, I am completely new to mongo/mongoose and therefore happy to have your package. I would like to add new parents to existing nodes and also rearrange/add nodes to the tree. Is the updating of the path supported when I delete a node or add a parent? Currently I tried to add/delete node but the path does not update like stated in the docu :/ Maybe I am doing something wrong? Thanks!

image

mfazeliLNC avatar Mar 07 '23 12:03 mfazeliLNC

Please provide some code for me to understand what you are trying to do.

vikpe avatar Mar 07 '23 15:03 vikpe

@vikpe This plugin doesn't work with the "findOneAndUpdate" hook and I think this is the problem he is facing (just like I am). I am using nestjs-query and it doesn't trigger save middleware but triggers findOneAndUpdate middleware. How can we make it work also with the "findOneAndUpdate"?

ilterugur avatar Mar 16 '23 16:03 ilterugur

@ilterugur I would have to update the plugin to support findOneAndUpdate; I'll create a separate issue, see #49 .

vikpe avatar Mar 17 '23 21:03 vikpe