Reputation: 61
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
Upvotes: 1
Views: 46
Reputation: 2949
Welcome to SO,
you should be using
await database.models.updateMany( { <queue> }, { $push: { 'object.array': 'Hello, World!' }});
Upvotes: 1