I have a custom form object structure that I successfully use with mongodb.
I am exploring the possibility of replacing Mongo with DocumentDb.
The My Class structure consists of a basic control from which various types of control are inherited. e.g. Text Field Management, Dropdown Control
In mongo, I use the discriminator field to store the actual type in the C # DocumentDb driver, which I cannot see to find the same function.
Below is an example of how mongo stores my class structure.
{ "_t" : "TextboxControl", "LabelText" : "Location of incident", "IsRequired" : true, "_id" : "cbe059d9-b6a9-4de2-b63b-14d44b022e37" }
In documentdb, the structure looks like
{ "LabelText": "Location of incident", "IsRequired": true, "id": "cbe059d9-b6a9-4de2-b63b-14d44b022e37" }
As you can see, the mongo version has the property “_t” indicating the actual type, this is used when I read the data to create the correct type. In documentdb version, it's just a field type
source share