inheritance in document database?

前端 未结 2 1739
既然无缘
既然无缘 2021-01-01 12:39

I am wondering because I searched the pdf \"[noSql] the definitive guide\" and \"beginning [noSql]\" for the word \"inheritance\" but I didn\'t find anything? am I missing s

2条回答
  •  盖世英雄少女心
    2021-01-01 12:58

    Well it's a pretty old question, but since I ended up here I'd like to add a 2017 update.
    If your using mongoose to connect to MongoDb you may want to check out discriminators:

    Discriminators are a schema inheritance mechanism. They enable you to have multiple models with overlapping schemas on top of the same underlying MongoDB collection.

    Documentation was a little bit vague for me at first, this article could be a better place to grasp the idea.

提交回复
热议问题