I'm using mongoose version 1.2.0 and as soon as I created a new instance of a mongoose model, the _id
is already set.
coffee> u = new User()
[object Object]
coffee> u._id
4dd68fc449aaedd177000001
I also verified that after I call u.save()
the _id
remains the same. I verified via MongoHub that this is indeed the real ID saved into MongoDB.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…