Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$addToSet not behaving as it should #424

Open
dor-benatia opened this issue Jan 26, 2022 · 0 comments
Open

$addToSet not behaving as it should #424

dor-benatia opened this issue Jan 26, 2022 · 0 comments

Comments

@dor-benatia
Copy link

Hi , iv'e stumbled across a weird problem with mongo $addToSet in patch function,

i am running this code :

service.create({
'test':'1,
'links':['a','b']
})

after that i am doing : super.patch(null,{ '$addToSet': { links: [ 'test1', 'test2', 'test3' ] }}, { 'test':1 });
when looking at the object in the db i see links: ['a','b',test1', 'test2', 'test3' ] which correspond to $addToSet with $each operator as explained in these docs: https://docs.mongodb.com/manual/reference/operator/update/addToSet/#value-to-add-is-an-array

which should of added this array as single element.

what am I missing?

feathers-mongoose version: 8.5.1
mongo 4.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant