Search code examples
socrata

How to use order and where in Socrata SOQL in a big table NYC 311 table?


I apologize if this is obvious but please see:

curl 'https://data.cityofnewyork.us/resource/fhrw-4uyv.json?$order=created_date+desc'

if you focus on created_date

returns:

      "created_date" : "2016-04-30T02:55:27.000"
      "created_date" : "2016-04-30T02:34:58.000",
      "created_date" : "2016-04-30T02:13:14.000",

NOTICE 2016-04-30T02:55:27.000 is close to the current date and time

But

curl 'https://data.cityofnewyork.us/resource/fhrw-4uyv.json?incident_zip=%2711205%27&$order=created_date+desc&$limit=1'

returns:

"created_date": "2015-04-16T23:25:08.000",

NOTICE 2015-04-16T23:25:08.000 is about a YEAR AGO! But it should be 2016. What is incorrect?

Even a simple request such as:

curl 'https://data.cityofnewyork.us/resource/fhrw-4uyv.json?$select=created_date&$order=created_date+desc'

returns

,{"created_date":"2015-04-17T02:10:54.000"}
,{"created_date":"2015-04-17T02:07:08.000"}
,{"created_date":"2015-04-17T02:06:11.000"}
,{"created_date":"2015-04-17T02:05:33.000"}

Please use the NYC 311 table. It may be related to the size of the table. Thanks.


Solution

  • Our engineers were able to resolve the issue and things should be returning results that are more sane now. Let me know if things look good from your end too.