Hi,
When I moving sql replication scripts from Raven 2.5 to Raven 3.0, I find some problem:
I have one collection that some documents' structure are different from others, for example
Normal document :
{
Profile:
{
FirstName : "ddd",
MiddleName : "hhh",
LastName : "aaa"
}
Email : "xxxxxx@xxx",
DateOfDirth : "1999/1/1",
Address :
{
Street : "dddddddddddd",
City : "hhhhhh"
State : "llll"
}
}
But when I have some document like :
{
Profile:
{
FirstName : "ddd",
MiddleName : "hhh",
LastName : "aaa"
}
Email : "xxxxxx@xxx",
Gender : uuuu,
DateOfDirth : "1999/1/1",
Address :
{
Street : "dddddddddddd",
City : "hhhhhh"
State : "llll"
}
}
And in the SQL replication script I want to map Gender value into the SQL side.
Previously in 2.5, Raven mapping will automatically replicate all the documents and just leave the column to null when the document doesn't have the Gender part, but in 3.0 it will throw errors consider the documents without Gender part have some problem and didn't replicate the document at all. So How can I resolve this problem?
Another problem is if some part of the document is null, like:
{
Profile:
{
FirstName : "ddd",
MiddleName : "hhh",
LastName : "aaa"
}
Email : "xxxxxx@xxx",
Gender : uuuu,
DateOfDirth : "1999/1/1",
Address : null
}
If I use the mapping in the SQL replication code like :
Street : this.Address.Street,
It will throw an error to me said Address is null and didn't replicate the document at all in Raven 3.0. But in 2.5 it will automatically make the Street column on SQL side to null without any error occur. How can I resolve this problem?
Thank you
Yanjie Zhou