I have a Mongodb based Feathers service : Categories and the model is as follows
{
_id : 'SOMEKEY',
categoryName : 'XYZ'
categoryItems : [
{ item_id : 'ITEMID' }
]
}
Now I have After hooks on my Items service that on each Create I want to push the reference of that Item into the categoryItems array in the Categories document. How can I achieve that ? Neither of the built in methods for Category service will help. Should I be writing Mongoose queries within my hook? If I do that I am depending on Mongoose MongoDB and if my database changes I will have to change all my hooks.