feathersjs-ecosystem / feathers-mongodb

A mongodb service for feathers
MIT License
122 stars 42 forks source link

$push not working as expected #210

Closed ericuldall closed 2 years ago

ericuldall commented 2 years ago

Feathers ^4.5.12

method: 'patch',
path: 'message-groups',
id: 622aa86fd15360001017f949,
data: { '$push': { hiddenBy: 620471fee097e159cbccec8a } }

Pulled that data from my context and the new ObjectID isn't getting added to the hiddenBy array. I feel like i'm missing something painfully obvious but wanted to be sure. Any insights?

ericuldall commented 2 years ago

Nvm, self inflicted pain. I use the keep middleware and it is not currently smart enough to scan past mongodb commands to actual keys. Just need to add keep(...keys, '$push') and it's working.