Moonshard
# Class: Crud<T>
# Type parameters
- T
# Hierarchy
- Crud
# Index
# Constructors
# Properties
# Methods
# Constructors
# constructor
+ new Crud(Document
: {}, options
: CrudOptions): Crud
# Parameters:
Name | Type | Default value |
---|---|---|
Document | {} | - |
options | CrudOptions | {} |
Returns: Crud
# Properties
# Document
• Document: {}
# Model
• Model: Model<T>
# createDto
• createDto: any
# updateDto
• updateDto: any
# Methods
# create
▸ create(body
: any): Promise<any>
# Parameters:
Name | Type |
---|---|
body | any |
Returns: Promise<any>
# list
▸ list(): Promise<T[]>
Returns: Promise<T[]>
# remove
▸ remove(id
: string): Promise<any>
# Parameters:
Name | Type |
---|---|
id | string |
Returns: Promise<any>
# replace
▸ replace(id
: string, body
: any): Promise<any>
# Parameters:
Name | Type |
---|---|
id | string |
body | any |
Returns: Promise<any>
# show
▸ show(id
: string): Promise<T>
# Parameters:
Name | Type |
---|---|
id | string |
Returns: Promise<T>
# update
▸ update(id
: number | string, body
: any): Promise<any>
# Parameters:
Name | Type |
---|---|
id | number | string |
body | any |
Returns: Promise<any>