Hello, I'm trying to set up my Sanity so that daily (or weekly/etc) the order of a Document List will change.
What I'm trying to do is to shift all elements by "1", basically rotating the whole list, so that if I have 7 elements and they change daily, every day the list would rotate and have a different document shown first.
How would I go about this? My idea was to edit the orderRank via GROQ mutation, but the actual field doesn't show a simple number, for example my first element now says 0|100008: and the second 0|10000o:. Would using lexoRank.genNext() be the way, as in the source code?
Hello, I'm trying to set up my Sanity so that daily (or weekly/etc) the order of a Document List will change.
What I'm trying to do is to shift all elements by "1", basically rotating the whole list, so that if I have 7 elements and they change daily, every day the list would rotate and have a different document shown first.
How would I go about this? My idea was to edit the
orderRank
via GROQ mutation, but the actual field doesn't show a simple number, for example my first element now says0|100008:
and the second0|10000o:
. Would usinglexoRank.genNext()
be the way, as in the source code?Thanks for the help!