Bolton-and-Menk-GIS / restapi

Python API designed to work externally with ArcGIS REST Services to query and extract data, and view service properties. Uses arcpy for some functions if available, otherwise uses open source alternatives to interact with the ArcGIS REST API. Also includes a subpackage for administering ArcGIS Server Sites.
GNU General Public License v2.0
93 stars 31 forks source link

Is there a way to get the number of records without doing a query with exceed_limit=true? #33

Closed phauly closed 4 years ago

phauly commented 4 years ago

I'm wondering if there is a way to get the number of records without doing a complete query. Doing a query with exceed_limit=True and then accessing count as in the example in the documentation is an option but it is very time consuming and resource demanding for the server I guess. Thank you!

phauly commented 4 years ago

I've seen that in the query page there is the option for "Return Count Only"

phauly commented 4 years ago

Yep, just found looking in the code for "Return Count Only" that there is returnCountOnly and in fact lyr.query(returnCountOnly=True) works fine. I'm going to close the issue, sorry for bothering you!

CalebM1987 commented 4 years ago

Yes, that is the solution. Thank you for closing this. One thing we need to do is update the documentation for this package to make it easier to find information like that. Most of the samples in the README are from 4-5 years ago when I first published this package 😬