Missing Mixed field in Forest admin

I have a field of type Schema.Types.Mixed on one of my models but it doesn’t seem to appear in the forest admin console for that model. I have tried going into the layout to add the field but it is not listed there either. How do I get it to appear in there? Thanks/

Hello @Richard_Garner,

Could you please fill in the info that was asked in the topic template? It’ll help us identify the problem you’re facing.

Expected behavior

Please describe here the behavior you are expecting.

Actual behavior

What is the current behavior?

Failure Logs

Please include any relevant log snippets, if necessary.

Context

Please provide any relevant information about your setup.

  • Package Version:
  • Express Version:
  • Sequelize Version:
  • Database Dialect:
  • Database Version:
  • Project Name:

In addition to this information, I’d like to know a few more things about this field:

  • did you add this field recently, to an existing project?
  • can you check if this field had been added to the file forestadmin-schema.json?
  • do you have any error in the console when starting your agent?

Thanks

I have a field of type Schema.Types.Mixed on one of my models but it doesn’t seem to appear in the forest admin console for that model. I have tried going into the layout to add the field but it is not listed there either. How do I get it to appear in there? Thanks/

Expected behavior

In the forest admin console, when I list my model instances, I should be able to see my field which is of type Schema.Types.Mixed, or at least be able to set it in the Layout Editor for that model.

Actual behavior

It’s not available to add in the Layout Editor and is not visible when listing the instances.

Failure Logs

N/A

Context

Recently upgraded to v7 from v3 of forest-express-mongoose. I believe it was okay before this.

  • Package Version: 7.7.1
  • Express Version: 4.17
  • Sequelize Version: n/a
  • Database Dialect: MongoDB
  • Database Version: 4.4.3
  • Project Name: OT
  • did you add this field recently, to an existing project?

No, but I have upgraded from v7 of forest-express-mongoose since I last noticed it working.

  • can you check if this field had been added to the file forestadmin-schema.json ?

Yes, but it appears to have a null value for the type

}, {
      "field": "categoryScores",
      "type": null,
      "defaultValue": null,
      "enums": null,
      "integration": null,
      "isFilterable": true,
      "isPrimaryKey": false,
      "isReadOnly": false,
      "isRequired": true,
      "isSortable": true,
      "isVirtual": false,
      "reference": null,
      "inverseOf": null,
      "validations": [{
        "message": null,
        "type": "is present",
        "value": null
      }]
    }, {
  • do you have any error in the console when starting your agent?

Sorry, not sure what you mean by the agent. Is that the process that uses forest-express-mongoose?

Hello @Richard_Garner,

Yes, by agent I mean the process that uses forest-express-mongoose. I’d like to know if there is any message in the console indicating that there is an error.

If you have access to the previous forestadmin-schema.json you had before the upgrade, could you please check if the field categoryScores is declared the same way?

What kind of values this field can contain?

Sorry for the delay. Before the upgrade the entry looked like this:

}, {
      "field": "categoryScores",
      "type": null,
      "defaultValue": null,
      "enums": null,
      "integration": null,
      "isFilterable": true,
      "isReadOnly": false,
      "isRequired": true,
      "isSortable": true,
      "isVirtual": false,
      "reference": null,
      "inverseOf": null,
      "validations": [{
        "message": null,
        "type": "is present",
        "value": null
      }]
    }, {

The only difference I can see id that there is no primaryKey property before, although this is false anyway.

I have checked for errors in the logs too. There don’t seem to be any related to forest admin. All the forest endpoints called return successfully. On startup of my server, though, there is a Mongo warning, although this hasn’t caused any issues elsewhere and only happen on startup.

(node:3911) Warning: Accessing non-existent property 'MongoError' of module exports inside circular dependency

The logs for the forest api calls look like this when I access the score items in the forest admin web console.

POST /forest/authentication 200 0B - 1.377 ms
OPTIONS /forest/authentication/callback?code=Nw9CMhdoPzSnyfFClMBr3sJqlzAXD9t3MzZiPgEEuh7kFLXfNOEkf0PojJjgU4Mt&state=%7B%22renderingId%22%3A51691%7D 204 0B - 0.209 ms
OPTIONS /forest/Score?timezone=Australia%2FMelbourne&fields%5BScore%5D=_id%2CsecondUserId%2CuserId%2ClastUpdated%2CoverallScore%2ClastDealbreakerQuestionTriggered&fields%5BsecondUserId%5D=name&fields%5BuserId%5D=name&page%5Bnumber%5D=1&page%5Bsize%5D=10&searchExtended=0&sort=-_id 204 0B - 0.320 ms
GET /forest/Score?timezone=Australia%2FMelbourne&fields%5BScore%5D=_id%2CsecondUserId%2CuserId%2ClastUpdated%2CoverallScore%2ClastDealbreakerQuestionTriggered&fields%5BsecondUserId%5D=name&fields%5BuserId%5D=name&page%5Bnumber%5D=1&page%5Bsize%5D=10&searchExtended=0&sort=-_id 200 0B - 14.234 ms
OPTIONS /forest/Score/count?fields%5BScore%5D=_id%2CsecondUserId%2CuserId%2ClastUpdated%2CoverallScore%2ClastDealbreakerQuestionTriggered&fields%5BsecondUserId%5D=name&fields%5BuserId%5D=name&searchExtended=0&timezone=Australia%2FMelbourne 204 0B - 0.219 ms
GET /forest/Score/count?fields%5BScore%5D=_id%2CsecondUserId%2CuserId%2ClastUpdated%2CoverallScore%2ClastDealbreakerQuestionTriggered&fields%5BsecondUserId%5D=name&fields%5BuserId%5D=name&searchExtended=0&timezone=Australia%2FMelbourne 200 14B - 4.242 ms
OPTIONS /forest/Score/60e7d679cc9ac196da463c69?timezone=Australia%2FMelbourne 204 0B - 0.216 ms
GET /forest/Score/60e7d679cc9ac196da463c69?timezone=Australia%2FMelbourne 200 0B - 16.698 ms

Hello,

I tested with forest-express-mongoose v6 and v7, and I have the same behavior in both cases: the Mixed field is not displayed by Forest Admin.

What kind of data do you handle with this field?

Which version were you using before upgrading to v7?

It’s a simple shallow key pair object but the keys are dynamic.

And what version are you upgrading from?