deno.land / x / mongoose@6.7.5 / benchmarks / typescript / simple / index.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { Schema, Model, model } from 'mongoose';
interface User { name: string; email: string; avatar?: string;}
interface UserModelInterface extends Model<User> { fetchUser(name: string): Promise<User>;}
const schema = new Schema<User>({ name: { type: String, required: true }, email: { type: String, required: true }, avatar: String});
const UserModel = model<User, UserModelInterface>('User', schema);
mongoose

Version Info

Tagged at
a year ago