-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Labels
Description
Hi,
We have a typed data structure with data models based on class inheritance.
To save/read data on cosmosdb we use Newtonsoft (de)serialization which normally works fine. Example of data model:
public class Pet
{
public string Name { get; set; }
}
public class Dog : Pet
{
public string OtherName { get; set }
}
This is a piece of saved document how it is persisted:
{
...,
"myFavouritePet": {
"$type": "MyProject.Pets.Dog, MyProject",
"Name": "Foo",
"OtherName": "OtherFoo"
},
...
}
After running the migration tool, from cosmos-nosql source to json or other cosmos-nosql sink, the migrated data contains everything except the "$type" property:
{
...,
"myFavouritePet": {
"Name": "Foo",
"OtherName": "OtherFoo"
},
...
}
Not sure if that is internal tool issue or rather the configuration. Here is the exemplary setting I use:
{
"Source": "cosmos-nosql",
"Sink": "cosmos-nosql",
"SourceSettings": {
"UseRbacAuth": true,
"AccountEndpoint": "https://...",
"EnableInteractiveCredentials": true,
"Database": "mySourceDb",
"Container": "mySourceContainer",
"IncludeMetadataFields": true,
"InitClientEncryption": false,
},
"SinkSettings": {
"ConnectionString": "AccountEndpoint=https://...;AccountKey=...",
"Database": "myDatabase",
"Container": "myContainer",
"PartitionKeyPath": "myPartitionKeyPath",
"RecreateContainer": true,
"IncludeMetadataFields": true,
"WriteMode": "InsertStream",
"PreserveMixedCaseIds": true,
},
}
Thanks in advance!