Summary
Sorting via the documented ?sort=field:asc|desc syntax returns 500 {"success":false,"message":"Something went wrong."} for many fields — including every field on /movie and /quote?sort=dialog. It succeeds only for a few fields (e.g. character.name, book.name). Filtering, pagination, and non-sorted requests on the same endpoints all work (200).
Reproduction
All requests use a valid Authorization: Bearer <key>. Base URL https://the-one-api.dev/v2.
| Request |
Status |
GET /movie?limit=2 (no sort) |
200 ✅ |
GET /movie?academyAwardWins>=1 (filter) |
200 ✅ |
GET /character?sort=name:asc |
200 ✅ |
GET /book?sort=name:asc |
200 ✅ |
GET /movie?sort=name:asc |
500 ❌ |
GET /movie?sort=runtimeInMinutes:asc |
500 ❌ |
GET /movie?sort=boxOfficeRevenueInMillions:desc |
500 ❌ |
GET /quote?sort=dialog:asc |
500 ❌ |
GET /character?sort=race:asc |
500 ❌ |
Ideas for fix
Claude is suggesting checking if you have indexes on the fields that ARE working (e.g. character.name) and that maybe you need indexes for the other vals as well. I'm not a MongoDB guy so not sure
Summary
Sorting via the documented
?sort=field:asc|descsyntax returns500 {"success":false,"message":"Something went wrong."}for many fields — including every field on/movieand/quote?sort=dialog. It succeeds only for a few fields (e.g.character.name,book.name). Filtering, pagination, and non-sorted requests on the same endpoints all work (200).Reproduction
All requests use a valid
Authorization: Bearer <key>. Base URLhttps://the-one-api.dev/v2.GET /movie?limit=2(no sort)GET /movie?academyAwardWins>=1(filter)GET /character?sort=name:ascGET /book?sort=name:ascGET /movie?sort=name:ascGET /movie?sort=runtimeInMinutes:ascGET /movie?sort=boxOfficeRevenueInMillions:descGET /quote?sort=dialog:ascGET /character?sort=race:ascIdeas for fix
Claude is suggesting checking if you have indexes on the fields that ARE working (e.g. character.name) and that maybe you need indexes for the other vals as well. I'm not a MongoDB guy so not sure