Closed doob9p closed 9 months ago
Hi. The default implementation for numeric incremental identifiers, if it does not meet your requirements, you can provide your own implementation in this way:
import { PrismaClient } from "@prisma/client";
import { pagination } from "prisma-extension-pagination";
const prisma = new PrismaClient().$extends(
pagination({
cursor: {
getCursor({ id }) {
return id;
},
parseCursor(cursor) {
return {
id: cursor,
};
},
},
}),
);
extension.js
Because of the annotation in the "extension.js" file, the integrer type cursor id does not work.
I am using mongodb and the type of Id I am using is objectId