relations in mongoose with custom field

后端 未结 3 1773
说谎
说谎 2021-01-25 13:24

I\'ve seen many examples about mongoose and relations, but how can I create a reference to another entity into a custom field ?

var mongoose = require(\'mongoose         


        
3条回答
  •  梦谈多话
    2021-01-25 13:44

    This is supported since Mongoose 4.5, and is called virtuals population.

    Check my detailed answer on this (nearly duplicate) question.

提交回复
热议问题