Run pipeline batch

Version: 5.0

Now you can run the pipeline batchMongoDB Contacts to xConnect Migration. The new contact facetLoyaltyProgram will be created on xConnect contacts if the required data is available in MongoDB.

After you run the pipeline batch, there are multiple ways you can check to confirm the contact facet was properly created.

xConnect collection database

You can check the xConnect collection database for records that represent the new facet.

  1. Connect to one of the collection database shards.

  2. Use the following query:

RequestResponse
SELECT ContactId, FacetKey, FacetData
  FROM xdb_collection.ContactFacets
  WHERE FacetKey = 'LoyaltyProgram'

You should see a row for each MongoDB contact that has loyalty program data associated with it.

ContactId

FacetKey

FacetData

########-####-####-####-############

LoyaltyProgram

{"@odata.type":"#MigrationTool.Examples.Loyalty...

The following is the complete FacetData value:

RequestResponse
{
    "@odata.type":"#MigrationTool.Examples.Loyalty.LoyaltyProgramInfo",
    "MembershipId":100011,
    "EnrollmentDate":"1919-12-12T12:34:56.0000000Z",
    "HomeStoreId":"GARRISON01"
}

You can write an application that uses the xConnect search API to find contacts with the new facet.

RequestResponse
var model = new XdbRuntimeModel(CustomMigrationModel.Model);
Uri uri = ... //your xConnect server location goes here
var config = new XConnectClientConfiguration(model, uri);
await config.InitializeAsync();
using (var client = new XConnectClient(config))
{
    var contacts = client.Contacts
        .Where(c => c.GetFacet<LoyaltyProgramInfo>().HomeStoreId != null)
        .GetBatchEnumeratorSync();
    while (contacts.MoveNext())
    {
        foreach (var contact in contacts.Current)
        {
            var expandOptions = new ContactExpandOptions(LoyaltyProgram.DefaultFacetKey);
            var fullContact = await client.GetAsync<Contact>(contact, expandOptions);
            var loyaltyProgramInfoFacet = fullContact.GetFacet<LoyaltyProgramInfo>();
        }
    }
}

Do you have some feedback for us?

If you have suggestions for improving this article,