Skip to Content
0
Jan 16, 2021 at 05:56 AM

CAP NodeJS remove implicit sorting on primary key

340 Views Last edit Jan 16, 2021 at 02:08 PM 2 rev

Hello ,

We are facing an issue where every service defined in CAP (Nodejs module) returns the result set in sorted order of primary key by default . We want to remove this and provide our own custom sorting . However writing an order by statement after entity select is not causing any change to the output result set and is still sorted by primary key .

From cap documentation i have read that there is some implicit sorting mechanism involved here . In JAVA runtime we can remove the implicit sorting by adding cds.query.implicitSorting.enabled: false in some config file . (https://cap.cloud.sap/docs/java/development/properties) . How do we achieve the same in NodeJS environment? Please provide the full syntax if possible as i tried adding the same as a nested structure in package.json and it didnt work .

Regards,

Akshat Malhotra