Check out my code for testing NestJS with Mongoose in the file test.schema.ts:
@Schema({ timestamps: true })
export class Tests {
@Prop({ required: true, index: true })
testid: number;
@Prop({ required: false })
extra_id: string | number;
@Prop({ required: false })
points: number;
}
I encountered an error while working on this code. The error message is - "CannotDetermineTypeError: Cannot determine a type for the "Tests.extra_id" field (union/intersection/ambiguous type was used). Make sure your property is decorated with a "@Prop({ type: TYPE_HERE })
" decorator." Can anyone provide guidance on how to resolve this issue?