Class decorator that marks an entity class for use with Database.
@DataClass must be applied after @KeyPath (or @CompositeKeyPath) and performs the following at decoration time:
@DataClass
@KeyPath
@CompositeKeyPath
version
reflect-metadata
Optional schema version configuration.
Error - If no @KeyPath / @CompositeKeyPath annotation is found.
Error
Error - If more than one property-level @KeyPath annotation is present (use @CompositeKeyPath for multi-field keys instead).
@DataClass({ version: 2 })class User { @KeyPath({ generator: 'uuid' }) id!: string; @Index({ unique: true }) email!: string; name!: string;} Copy
@DataClass({ version: 2 })class User { @KeyPath({ generator: 'uuid' }) id!: string; @Index({ unique: true }) email!: string; name!: string;}
Class decorator that marks an entity class for use with Database.
@DataClassmust be applied after@KeyPath(or@CompositeKeyPath) and performs the following at decoration time:@KeyPath(or@CompositeKeyPath) annotation is present on the class.versioninreflect-metadata.