0

I am working in Sitecore 9.3 XConnect custom facet with MongoDB. I have created a custom facets model and JSON file and able to see custom facet attributes and values but facet key(Products) under content is missing in Mongo collection and I have doubt is it possible to create separate section for custom facet like content.

Facet Model:

[Serializable]
[FacetKey(DefaultFacetKey)]
public class Products : Facet
{
    public const string DefaultFacetKey = "Products";

    public int PersonId
    {
        get; set;
    }

    public centraldata CentralData
    {
        get;set;           
    }

    public Products()
    {
        
    }
}

Custom facet in MongoCollection

enter image description here

JSON Model

{
  "Name": "FacetSchema",
  "Version": "1.0",
  "References": [
    {
      "Name": "XConnect",
      "Version": "1.0"
    },
    {
      "Name": "Sitecore.XConnect.Collection.Model",
      "Version": "9.3"
    }
  ],
  "Types": {
    "Central.Provider.Sitecore.xDB.Facets.Products ": {
      "Type": "Facet",
      "BaseType": "Sitecore.XConnect.Facet",
      "ClrType": "Central.Provider.Sitecore.xDB.Facets.Products, Central.Provider.Sitecore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
      "Properties": {
        "PersonId": {
          "Type": "Int32"
        },
        "CentralData": {
          "Type": "Central.Provider.Sitecore.xDB.Facets.Products.CentralData"
        }
      }
    },
    "Central.Provider.Sitecore.xDB.Facets.Products.CentralData": {
      "Type": "Complex",
      "ClrType": "Central.Provider.Sitecore.xDB.Facets.Products.CentralData, Central.Provider.Sitecore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
      "Properties": {
        "Preferences": {
          "Type": "Central.Provider.Sitecore.xDB.Facets.Products.Preferences"
        },
        "Bookmarks": {
          "Type": [
            "Central.Provider.Sitecore.xDB.Facets.Products.Bookmark"
          ]
        },
        "FavoriteTools": {
          "Type": [
            "Central.Provider.Sitecore.xDB.Facets.Products.FavoriteTool"
          ]
        },
        "LikedContent": {
          "Type": [
            "Central.Provider.Sitecore.xDB.Facets.Products.LikedContent"
          ]
        }
      }
    },
  "Facets": [
    {
      "Target": "Contact",
      "Name": "Products",
      "Type": "Central.Provider.Sitecore.xDB.Facets.Products"
    }
  ]
}

Someone please help on this issue

3
  • Can you post the json model also?
    – Chris Auer
    Commented Jun 23, 2021 at 15:14
  • did you add any value to the facet? Commented Jun 23, 2021 at 16:07
  • @Chris.. I have added the JSON model Commented Jun 24, 2021 at 4:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.