aravindnc/mongoose-paginate-v2

Property 'options' does not exist on type '(schema: Schema<any, Model<any, any, any, any>, any, any>) => void'

kerolloz opened this issue · 5 comments

@ypicard This too.

Will look today.

@kerolloz @ypicard Package updated. Please verify.

LGTM.

add this line in model file

ShiftsSchema.plugin(paginate);

// make a interface
interface ShiftsDocument extends mongoose.Document { }

// user generic <ShiftsDocument, mongoose.PaginateModel<ShiftsDocument>>
export default mongoose.model<ShiftsDocument, mongoose.PaginateModel<ShiftsDocument>>("shifts", ShiftsSchema);