Hi!
TL;DR: Is there a way to return pages of n datavalues each from the dataValueSets endpoint to avoid getting memory issues on the receiving server?
We run nightly batch imports of data to DHIS2. Due to some issues related to our use of categories, we want to have an option to delete all data values for a given data element in a given date range before starting the import. My understanding is that the best way to perform such bulk deletions in DHIS2 is to first send a get request to the dataValueSets endpoint to retrieve the relevant data values, and then send a post request with importStrategy=DELETE to the same endpoint with all the retrieved data values as payload. (If there is a better way to do bulk deletion, please let me know )
The number of data values retrieved can be large, and to protect the memory of our server, I would like to iterate over the datavalues to delete without loading them all into memory. Is there a paging option for the dataValueSets endpoint that can help us with this endeavor? I have tried setting paging to True and a small pageSize, but this still returned the full set of data values. How can I resolve this?
Example from the play instance which returns more data values than the given pageSize: Login app | DHIS2