1

i'am trying a add new value to array inside object, this way:

await database.models.updateMany( { <queue> }, { $push: { object: { array: 'Hello, World!' }}});

but, thats delete the array inside the object instead of add new value

2
  • Show your schema please Commented Sep 19, 2020 at 19:04
  • it has already been resolved, but thanks anyway Commented Sep 19, 2020 at 20:51

1 Answer 1

1

Welcome to SO,

you should be using

await database.models.updateMany( { <queue> }, { $push: { 'object.array': 'Hello, World!' }});

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.