Skip to content

@iamcalegari/mongoat / BsonType

Function: BsonType()

BsonType(bsonType): (_value, context) => void

Defined in: src/schema/sugars.ts:16

Sugar over @Prop({ bsonType }).

Parameters

bsonType

string | string[]

Returns

(_value, context) => void

Example

typescript
class UserSchema {
  @BsonType('string')
  username!: string;
}