I have an HTTP endpoint which returns the result of a paginate call.
I would like to somehow serialize the next cursor to a format that I can pass as a query string parameter in the URL of the next request.
My next cursor looks something like:
[ 1597205896295000, Ref(Collection("posts"), "273622809807159820"), Ref(Collection("posts"), "273622809807159820") ]
I have tried to base64 encode it like this:
and decoding with:
JSON.parse(new Buffer(after, 'base64').toString('utf8'))
However, when I give the decoded array to my paginate call I get the following error:
Ref expected, Object provided.
Am I going about this in the best way?