Hello all,
Continuing my journey with the Cloud SDK for Javascript 🙂
I noticed that there is no "count()" function for generated entities, whereas it seems to be there when using the Java flavour of the SDK:
long doeCount = new DefaultBusinessPartnerService()
.getAllBusinessPartner()
.filter(BusinessPartner.LAST_NAME.eq("Doe"))
.count()
.execute();
Am I missing something?
Although not necessary, it can be useful to build a some sort of paging mechanism, considering APIs like the SuccessFactors one which extracts a maximum of 1000 objects per request.
Any hint?
Thanks,
Roberto.
Request clarification before answering.
Hi Roberto,
you are right, we are indeed missing the count operation right now. As this is not on our immediate roadmap, I'd encourage you to open a feature request if you're interested in this feature.
When it comes to paging, I think top and skip are the operators that can be used for that (analogously to LIMIT and OFFSET in SQL).
Best regards,
Dennis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dennis! 🙂
I will open the feature request!
That's ok for the paging, the total count is useful when dealing with UIs (table pagination usually needs the total count value to generate the number of pages). Anyway, the count can be obtained via a separated simple http call.
Thanks for your time!
Roberto.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.