Hi, I am not able to get my aggregate to sort based on a numerical field.
In my collection, I have a field “title” which has the items I am wanting to sort. There is also a field “number” which has the order in which the items go, eg:
title: item1 number: 0
title: item2 number: 1
title: item3 number: 2
etc. etc…
Some of the title fields repeat, so I am wanting to return only the unique items. Ultimately, the content of the title fields will be used as options in a dropdown menu. Every time I try to add a sort, the operation fails. With query and .distinct, it returns “the server failed to fulfill the request.” With aggregate and .group, it simply ignores the sort and returns them out of order.
The only other thing I could think to do is return the result of the query to an array and sort using normal javascript, but I would rather use the functionality in Wix because it would be a more flexible code block I could use over and over.
Thanks in advance