I have a Dto which looks like this:
import { Type } from "class-transformer";
import { ArrayMinSize, IsArray, ValidateNested} from "class-validator";
import { ObjectId } from "mongoose";
export class MongoIdDto {
@IsArray()
@ValidateNested({each: true})
@ArrayMinSize(1)
@Type(() => ObjectId)
ids: ObjectId[]
}
But this throws me an error:
'ObjectId' only refers to a type, but is being used as a value here.
How does this error occur?