Populate a mongoose model with a field that isn't an id

前端 未结 4 618
时光说笑
时光说笑 2020-12-02 19:10

Is it possible to populate a mongoose model with a field of a reference model that isn\'t the _id ... e.g. a username.

so something like

var personSc         


        
4条回答
  •  遥遥无期
    2020-12-02 19:56

    It seems they enforce to use _id, and maybe we can customize it in the future.

    Here is the issue on Github https://github.com/LearnBoost/mongoose/issues/2562

提交回复
热议问题