Node.js - Creating Relationships with Mongoose

前端 未结 2 755
予麋鹿
予麋鹿 2020-12-07 11:32

I have 2 Schemas, Custphone and Subdomain. Custphone belongs_to a Subdomain and Subdomain

2条回答
  •  無奈伤痛
    2020-12-07 11:59

    I had a similar problem and had to use mongoose's Model.findByIdAndUpdate()

    docs: http://mongoosejs.com/docs/api.html#model_Model.findByIdAndUpdate

    this post helped me also: http://blog.ocliw.com/2012/11/25/mongoose-add-to-an-existing-array/comment-page-1/#comment-17812

提交回复
热议问题