[Vuejs]-Faunadb after returning the same entries as the original ones

0👍

This is a duplicate question which I already answered here. Would you consider editing that one instead of opening a new one with extra information to keep Stack Overflow organized?

Given that your index contains two values (ts and ref) which I can derive from your lambda and from your previous question, this after syntax will not work. You will have to specify at least three values. Such a cursor will look like this:

  after: [
      1599220462170000,
      Ref(Collection("school_queries"), "275735235372515847"),
      Ref(Collection("school_queries"), "275735235372515847")
    ]

You might wonder why there are three values in there. That’s because the index contains your reference and the reference is always added to the cursor. Using it again in the index results in it being added twice. Why and/or whether we can’t optimise I can’t tell but that’s just how it works currently :).

If I adapt the after in your query, that’ll become something like:

 after: [
    1599220462170000,
    q.Ref(q.Collection("school_queries"), params.params.id)
    q.Ref(q.Collection("school_queries"), params.params.id)
  ]

0👍

In order to continue paginating I added the following after: [1599220462170000], this will continue to sort from this after timestamp.

Leave a comment