We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08154a9 commit 5ba0c0eCopy full SHA for 5ba0c0e
adminforth/dataConnectors/mongo.ts
@@ -222,9 +222,9 @@ class MongoConnector extends AdminForthBaseConnector implements IAdminForthDataS
222
}
223
224
async deleteRecord({ resource, recordId }): Promise<boolean> {
225
- const primaryKey = this.getPrimaryKey(resource);
226
const collection = this.client.db().collection(resource.table);
227
- const res = await collection.deleteOne({ [primaryKey]: recordId });
+ const primaryKeyColumn = resource.dataSourceColumns.find((col) => col.name === this.getPrimaryKey(resource));
+ const res = await collection.deleteOne({ [primaryKeyColumn.name]: this.setFieldValue(primaryKeyColumn, recordId) });
228
return res.deletedCount > 0;
229
230
0 commit comments