Get more than 10 records from forge customUI custom entity store

resolver.define("fetchTargetProject", async (req) => {
  try {
    const result = await storage
      .entity("target-project")
      .query()
      .index("by-targetSite")
      .where(WhereConditions.equalsTo(req.payload.targetSite.label))
      .getMany();
    return result;
  } catch (error) {
    console.error(
      "Error retrieving target project object by target site:",
      error
    );
  }
});

Code in static part is below :-

useEffect(() => {
    if (targetSite !== null) {
      invoke("fetchTargetProject", { targetSite }).then(setTargetProjData);
    }
  }, [targetSite]);

I dont know how many total records are stored in the entity. While getting the records, I am getting only 10 but want to get them all. Kindly help in how to get them all

@TejasviGarg,

The pattern for getting multiple pages of data is shows in the cursors section of the Custom Entities docs:

// Fetch a page of 10 results
const { nextCursor } = await storage.query().getMany();

// Fetch the next 10 results
await storage.query().cursor(nextCursor).getMany();

@ibuchanan

Can you implement the same as a form of example according to my code. I am not getting hold of the said commands of the cursor