0.0.8 • Published 1 year ago
mongodjay v0.0.8
MongoDjay
import { Model, Field, Index, MongoModel } from 'mongodjay'
@Model({ collection: 'products', timestamps: true })
@Index({ price: 1 })
export default class Product extends MongoModel {
@Field({ type: String, required: true, unique: true })
title!: string
@Field({ type: Number, min: 0.01 })
price!: number
createdAt!: Date
updatedAt!: Date
}