MongoDB Data Modeling

When MBI pulls in MongoDB data, that data is translated into a relational model.

The bad news: While most data patterns do not pose an issue, there are a few that, because of the translation to a relational model, MBI does not support.

The good news: All these patterns can be avoided.

Subnested Arrays

If your collection looks like the example below, MBI only replicates the data in the items array. Data from the subitems array are not pulled.

    {
        _id: 0000000000000001
        items: [
            {
                _id: 0000000000000002
               subItems: [
                   {
                       _id: 0000000000000003
                      name: "Donut"
                      description: "glazed"
                   }
               ]
            }
        ]
    }

Variable Object Keys

Collections that include objects with variable object keys are not replicated in MBI. For example:

    {
        _id: 0000000000000001
        friends: {
            0000000000000002: "Jimmy",
            0000000000000004: "Roger",
            0000000000000005: "Susan"
        },
    }

This usually occurs where an object is being used and an array would be more appropriate. Now, rework the above example:

    {
        _id: 0000000000000001
        friends: [
            { friend_id: 0000000000000002, name: "Jimmy" },
            { friend_id: 0000000000000004, name: "Roger" },
            { friend_id: 0000000000000005, name: "Susan"}
        ]
    }

On this page