Cannot update data - Unknown field "id" when dataset uses "_id"

Hi,

Unable to update any data in my admin dashboard deployed using the forest-agent on express on top of a postgres database - using @forestadmin/agent 1.8.2 - and it fails with

From my review, the schema looks good i.e. has captured that the primaryKey field is “_id”

{
  "actions": [],
  "fields": [
    {
      "defaultValue": null,
      "enums": null,
      "field": "_id",
      "integration": null,
      "inverseOf": null,
      "isFilterable": true,
      "isPrimaryKey": true,
      "isReadOnly": true,
      "isRequired": false,
      "isSortable": true,
      "isVirtual": false,
      "reference": null,
      "type": "Number",
      "validations": []
    }
  ],
  "icon": null,
  "integration": null,
  "isReadOnly": false,
  "isSearchable": true,
  "isVirtual": false,
  "name": "alert",
  "onlyForRelationships": false,
  "paginationType": "page",
  "segments": []
}

In the user interface, it’s clear that the field should be _id and that id is just a display name:
image

However, in the update body, I see that it’s passing id as part of the update, and not _id:

I’m not sure why it’s using “id” and not “_id” - and this has worked on previous versions of ForestAdmin, so would really appreciate some help here.

Hello @Arjun_Rajyagor,

Thanks for reaching out :raised_hands:

Indeed this looks pretty odd. We are going to look into it.
Out of curiosity, why are you using _id (and not id) in a postgres database?

Cheers.

Hi @Arjun_Rajyagor

We’re reproducing the issue on our side.

We’re filling a bug report on our tracker, and will update this thread once fixed

2 Likes

Thanks - in all honesty, I can’t remember why we set it up that way, but we’re here now :slight_smile:

1 Like

@Arjun_Rajyagor,

We released one part of the fix.
Could you check if it’s already functional for you?

Thanks a lot.

@Arjun_Rajyagor,

We deployed the 2nd part of the fix.
To benefit from it, please upgrade your @forestadmin/agent to 1.8.4.

Let me know!
Thanks.

Working now! Thanks folks :smiley:

2 Likes