Bob.Tern
Posts: 11
Joined: Wed Nov 15, 2023 7:02 am

How can delete a portion of data on one of my collections

Is there any way that I can delete a portion of data on one of my collections, using a query command? What I really need is delete some records of the collection "InventoryCounts" filtering for the field "store" Please help me with this ASAP. We am experiencing very slow performance in the application during our Physical Inventory process, so I am what to clean that collection to see if that will help.

aantsypau
Posts: 17
Joined: Wed May 24, 2023 7:57 am

Re: How can delete a portion of data on one of my collections

In this context, you have a number of potential options:

  1. Deleting a record using a conditional approach. Refer to the Batch operation for further details. More information can be found at this link: https://docs.appery.io/reference/databa ... operations
  2. Writing a server-side script that cycles through the rows of a collection, removing them based on a set condition.

If you find that the performance is sub-optimal, you might want to establish indexes for the columns participating in the 'where' conditions before removing any data. For additional information on this, you may visit: https://docs.appery.io/docs/database-co ... ns#indexes

It's worth mentioning that our users have databases with more than 100 million records in a single collection, and these continue to operate efficiently and effectively.

Return to “Issues”