-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
Currently, the discriminator is only going to get published without referencing the base class' discriminator. This provides certain problems when a 3 level hierarchy is setup as below:
Animal -> (no discriminator)
- Cat -> "Cat"
- Tiger -> "Tiger"
- Lion -> "Lion"
- Dog -> "Dog"
- Wolf -> "Wolf"
Currently, I cannot get all the Cats without a lot of work. In instead, we maintain the hierarchy of the classes in the discriminator, then we can search for
{ _t: "Cat" }and get back Tigers, Lions, and SuperLions.
Animal -> (no discriminator)
- Cat -> "Cat"
- Tiger -> ["Cat", "Tiger"]
- Lion -> ["Cat", "Lion"]
~ SuperLion -> ["Cat", "Lion", "SuperLion"]
- Dog -> "Dog"
- Wolf -> ["Dog, "Wolf"]
In addition, this change would be in line with the current way inheritance is handled in the mongodb-csharp driver. You can view the wiki link here: http://github.com/mongodb-csharp/mongodb-csharp/wiki/Inheritance