#community-help

Resolving `randomInt` Sorting Error in Flutter

TLDR Andrew was unable to sort field randomInt resulting in an error. Kishore Nallan resolved the issue by suggesting to add randomInt to the schema.

Powered by Struct AI
3
14mo
Solved
Join the chat
Oct 28, 2022 (14 months ago)
Andrew
Photo of md5-7766f890de99fa72a6d81315691a6758
Andrew
04:34 AM
Hey guys, getting an error. I have a field, randomInt, that im trying to sort by. Im using

'sort_by': 'randomInt:asc',

But its spitting out the error


"Could not find a field named `randomInt` in the schema for sorting."

Any idea whats going on with this? Im on flutter if that makes any difference.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
05:00 AM
When you created the collection, did you add randomInt to the schema?
Andrew
Photo of md5-7766f890de99fa72a6d81315691a6758
Andrew
04:50 PM
Looks like that did it, thanks!