MongoDB数据建模

当Adobe Commerce Intelligence拉入MongoDB数据时,该数据将转换为关系模型。

坏消息:虽然大多数数据模式不会造成问题,但有一些模式不受Commerce Intelligence支持,因为转换为关系模型。

好消息是,所有这些模式都可以避免。

子嵌套数组 subnested

如果您的集合与以下示例类似,Commerce Intelligence仅复制项数组中的数据。 不提取子项数组中的数据。

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

可变对象键 varobjectkeys

包含具有可变对象键的对象的集合未在Commerce Intelligence中复制。 例如:

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

这通常发生在使用对象并且数组更合适的地方。 现在,重新制作上面的示例:

    {
        _id: 0000000000000001
        friends: [
            { friend_id: 0000000000000002, name: "Jimmy" },
            { friend_id: 0000000000000004, name: "Roger" },
            { friend_id: 0000000000000005, name: "Susan"}
        ]
    }
recommendation-more-help
e1f8a7e8-8cc7-4c99-9697-b1daa1d66dbc