You can clear the database in mendix by
1.go to the console pane on the bottom
2.Click on Advanced and select Start built-in data viewer
then you can select and delete the database of the entities you want.
(I have attached some screenshots for reference)
Hi Indrani Sharma,
Better you create a button, in that button call a microflow and retrieve the entity objects which you want to delete. After coded deploy your code to production and use this button to delete objects.