Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/
Relational Migrator
/ /

Refactor the Litigation Domain

Litigations may have several parties involved, in which each party plays a specific role with an associated claim. Since the Claim and Litigation domains are closely related, we will embed fields in the claim domain apart from its identifier. This way, we can have a snapshot of the claim details at the time the litigation was made, so even if the claim details change, we won’t lose the original claim data associated with the litigation.

The Litigation domain includes the following key entities:

  • Litigation: Claim litigation

  • Litigation Party Role: An associative entity which links the following entities:

    • Claims

    • Party Roles

    • Insurable Objects

  • Insurable Object Party Role: An associative entity which links the following entities:

    • Party

    • Party Roles

    • Insurable Objects

The relationship between litigations and parties are the facilitated through the litigation_party_role table, which we will represent in MongoDB by using an embedded array.

Refactoring the Litigation domain is the fifth step of the insurance data model example tutorial. Before you refactor the Litigation domain, ensure that you:

1

On the right side of the screen, the Mappings menu opens.

2

Next to Mappings from relational tables, click Add. Click Embedded array and select litigation_party_role from the Source table drop-down menu.

Under the All fields checkbox, uncheck the litigationIdentifier field and click Save and close.

3

Next to Mappings from relational tables, click Add and select Embedded documents. Choose claim from the Source table drop-down menu.

Click Save and close.

4

Next to Mappings from relational tables, click Add and select Embedded documents. Choose insurable_object from the Source table drop-down menu. Ensure that the Root path prefix is set to litigationPartyRoles.claim.

Click Save and close.

5

Next to Mappings from relational tables, click Add and select Embedded array. Choose insurable_object_party_role from the Source table drop-down menu. Ensure that the Root path prefix is set to litigationPartyRoles.claim.insurableObjects.

Click Save and close.

6

Now that you mapped all the necessary tables to the litigation document, you can delete the following collections from the MongoDB view of Relational Migrator:

  • agreementPartyRole

  • litigationPartyRole

  • insurableObject

  • insurableObjectPartyRole

  • locationAddress

  • insurableObjectParty

You have modeled the entire relationship schema in just five collections:

  • party

  • partyRole

  • policy

  • claim

  • litigation

Now that you completed your model, you need to migrate the data to your MongoDB instance.

Back

Refactor the Claim Domain

On this page