I want to remove object to use mongodb.
First find ID and second remove only AAA field.
I tried it to use findOneAndDelete function. but It wrong worked.
It worked Find(OK) and Delete query(false).
I want to keep other filed and remove target filed(AAA).
please share your idea.
below example code.
{ id: 6319, AAA : Object , BBB : Object , CCC : Object },
result = await User.findOneAndDelete({id : 6319 },{ projection : { AAA : Object } });