Skip to content

Latest commit

 

History

History
33 lines (20 loc) · 477 Bytes

File metadata and controls

33 lines (20 loc) · 477 Bytes

findOne()

Find a single document by its id in collection.

Usage

const model = data.model('foo', {name: String});

// Find first document
await data.findOne(model);

// Find nth document
await data.findOne(model, 50);

// Find document by query
await data.findOne(model, {name: 'Joe'});

Arguments

  • string

Return

Promise<DataDocument>

Notes

## Find by id

View Ids for more information.