Skip to content

Latest commit

 

History

History
37 lines (22 loc) · 611 Bytes

UpdateOne.md

File metadata and controls

37 lines (22 loc) · 611 Bytes

updateOne()

Find a single document by its id in collection.

Usage

const model = data.model('foo', {score: Number});

// Update first document
await data.updateOne(model, {}, {score: 100});

// Update nth document
await data.updateOne(model, {}, {score: 100}, 50);

// Use a setter (view below for list of updaters)
await data.updateOne(model, {}, {score: data.sum(100)});

Arguments

  • string

Return

Promise<DataDocument>

Notes

## Update by id

View Ids for more information.

Updaters

List of updaters