0

I have this schema in a node.js app

(...)
numbers:{
    highest: Number,
    history:[{number: Number, date: Date}]
}
(...)

and I need to update this part, so I do (high, score and date being variables with a number, another number and a New Date()

Users.update({ 'name': user.name},
    { $set: { 'numbers.highest': high},
        $push: { 'numbers.history': { number: score, date: date}}
    }

So far, so good...but when I look in my collection I got an array with the two values (great) but also an _id. And this _id is the same of the document.

I tried making the same update on the mongo console and that worked just fine...no _id's

Do you know what that can be? Cheers

André Lucas
  • 1,788
  • 1
  • 18
  • 36

0 Answers0