deep-jade16mo ago

Inferencer - how to use a diferent identifer id

Hi, I want to use the Inferencer (MUI) to generate the views for my data. However, my data use the key "_id" instead of "id" as my identifier (I'm using mongodb database). Is there a way to parameters the Inferencer to use _id instead of id? Thanks a lot
4 Replies
like-gold16mo ago
Hello @yacine4340 , hope you are doing well! Unfortunately it's not possible at the moment. Inferencer expects ID field to be present. You can explore if it's possible to return id field, instead of _id from the data provider. If your problem persists, feel free to create an issue on GitHub. Best
compatible-crimson16mo ago
Also you can do customize your data provider to add id field according to the '_id'. So the change will only happen in refine side
yappiest-sapphire16mo ago
Went to post a new question and saw this discussion. @yacine4340 you can check out this (rather long) discussion we had Tldr; you can take the Inferencer code and customize it, and take the id prop instead of the hard-coded 'id'. Obviously a workaround, hopefully sometime in the next big version^tm we'll get access to this change more easily 🙂
Discord - A New Way to Chat with Friends & Communities
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
deep-jade16mo ago
@batuhanw @aliemirs Thanks for the quick feedback. I followed your direction with a custom data provider and it worked.