Hi,
I am wondering that is the best way to map entity (in this case Clinician) collections of collections inside document? I attached the JSON example and Index example which I started. Its easy for collection with primitive values, but more complex mapping is still mystery for my as I am just growing wings as Raven DB does too :) Any advice? Thanks in advance.
The Lucene query would be something like tahat:
IsAcceptingNewPatients: true AND DepartmentsName: Optometry
Assume that C# property SpecializationsAndDepartments=>Departments=> mapped to DepartmentName
{
"Languages": [
"Spanish"
],
"SpecializationsAndDepartments": [
{
"Name": "Braintree",
"Specializations": [],
"Departments": [
"Optometry"
]
},
{
"Name": "Quincy",
"Specializations": [],
"Departments": [
"Optometry"
]
}
],
"ClinicianId": 4796,
"LastName": "beam",
"FirstName": "jim",
"Gender": "M",
"ProfessionalDegrees": [
"OD"
],
"ProfessionalTitles": [
"Optometrist"
],
"IsPrimaryCarePhysician": false,
"IsAcceptingNewPatients": false,
"Uid": "jim-beam-4796"
}
/// <summary>
/// The LINQ Query view indexes
/// </summary>
public sealed partial class FindClinicianById : AbstractIndexCreationTask<Clinician>
{
/// <summary>
/// The Raven Index Name
/// </summary>
public static readonly string RavenIndexName = typeof(FindClinicianById).Name;
/// <summary>
/// Initializes a new instance of the <see cref="FindClinicianById"/> class.
/// </summary>
public FindClinicianById()
{
Map = documents => from clinician in documents
select new
{
clinician.LastName,
clinician.IsPrimaryCarePhysician,
clinician.IsAcceptingNewPatients,
clinician.Gender,
ProfessionalDegree = clinician.ProfessionalDegrees,
Language = clinician.Languages,
DepartmentName = ?????????????????????????????? };
}
}