- updateById(id, model, data, populateFields?): Promise<undefined | null | Document<any, any, any> & {
_id: ObjectId;
}>
-
Parameters
-
id: string
-
model: Model<Document<any, any, any>, {}, {}, {}, any>
-
data: any
-
populateFields: string[] = []
Returns Promise<undefined | null | Document<any, any, any> & {
_id: ObjectId;
}>
updated document
Update a document by id
Throws
mongoose error
Example
Example
if you want to populate fields in response