Skip to main content

Class: FindByIdOptions

Constructors

constructor

new FindByIdOptions(data)

Parameters

NameType
dataFindByIdOptions

Defined in

handler/find/find-by-id-options.ts:18

Properties

enforceRefCheck

Optional enforceRefCheck: boolean | "throw"

Defined in

handler/find/find-by-id-options.ts:17


lean

Optional lean: boolean

Documents returned from queries with the lean option enabled are plain javascript objects, not Ottoman Documents. They have no save methods, hooks or other Ottoman Document's features.

Example

const document = await UserModel.findById(id, { lean: true });
document instanceof Document; // false

Defined in

handler/find/find-by-id-options.ts:16


populate

Optional populate: string | string[]

Defined in

handler/find/find-by-id-options.ts:3


populateMaxDeep

Optional populateMaxDeep: number

Defined in

handler/find/find-by-id-options.ts:7


select

Optional select: string | string[]

Defined in

handler/find/find-by-id-options.ts:2


timeout

Optional timeout: number

Defined in

handler/find/find-by-id-options.ts:6


transcoder

Optional transcoder: any

Defined in

handler/find/find-by-id-options.ts:5


withExpiry

Optional withExpiry: boolean

Defined in

handler/find/find-by-id-options.ts:4