Untitled

 avatar
unknown
plain_text
a year ago
1.1 kB
4
Indexable
const collection = 'coins';

export type CoinDocument = HydratedDocument<Coin>;

@Schema({ timestamps: true, collection })
@BuilderSchema(collection)
export class Coin extends BaseSchema {
  @Prop({ type: Number })
  rank: number;

  @Prop({ type: String })
  image: string;

  @Prop({ type: String })
  name: string;

  @Prop({ type: String })
  link: string;

  @Prop({ type: String, unique: true })
  key: string;

  @Prop({ type: Number })
  price: number;

  @Prop({ type: Number })
  '1h': number;

  @Prop({ type: Number })
  '24h': number;

  @Prop({ type: Number })
  '7d': number;

  @Prop({ type: Number })
  volume: number;

  @Prop({ type: Number })
  marketCap: number;

  @Prop({ type: Number })
  fullyDilutedValuation: number;

  @Prop({ type: Number })
  twentyFourHoursTradingVolume: number;

  @Prop({ type: Number })
  circulatingSupply: number;

  @Prop({ type: Number })
  totalSupply: number;

  @Prop({ type: String })
  maxSupply: string;
  views: number;
}

export const CoinSchema = SchemaFactory.createForClass(Coin);
Editor is loading...
Leave a Comment