Open simonpaul08 opened 10 months ago
Facing same issue here and I just wanted to know if you figured something out?
You're facing the same issue, but what's the issue exactly?
still getting the same error, no solution yet. It could be because of the type "module" but I am not sure
Can you please report the exact error? In your initial report there is only the code, not the error. Otherwsie, can you make a reproduction?
It has error: Argument of type 'typeof import("mongoose")' is not assignable to parameter of type 'Schema<any, Model<any, any, any, any, any, any>, {}, {}, {}, {}, DefaultSchemaOptions, { [x: string]: unknown; }, Document<unknown, {}, FlatRecord<{ [x: string]: unknown; }>> & FlatRecord<...> & Required<...>>'.
This is the code for the Schema =>
import mongoose, { Schema } from "mongoose"; import Inc from 'mongoose-sequence';
const AutoIncrement = Inc(mongoose);
const noteSchema = new Schema( { user: { type: mongoose.Schema.Types.ObjectId, required: true, ref: 'User' }, title: { type: String, required: true }, text: { type: String, required: true }, completed: { type: Boolean, default: false } }, { timestamps: true } )
noteSchema.plugin(AutoIncrement, { inc_field: "ticket", id: "ticketNums", start_seq: 500 });
export default mongoose.model('Note', noteSchema);
do let me know what am I doing wrong..