Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/typeorm/src/find-options/FindOneOptions.ts>FindOneOptions

Forked from https://github.com/typeorm/typeorm
Latest
interface FindOneOptions
import { type FindOneOptions } from "https://deno.land/x/typeorm@v0.2.23-rc10/src/find-options/FindOneOptions.ts";

Defines a special criteria to find specific entity.

Type Parameters

optional
Entity = any

Properties

optional
select: (keyof Entity)[]

Specifies what columns should be retrieved.

optional
where:
| FindConditions<Entity>[]
| FindConditions<Entity>
| ObjectLiteral
| string

Simple condition that should be applied to match entities.

optional
relations: string[]

Indicates what relations of entity should be loaded (simplified left join form).

optional
join: JoinOptions

Specifies what relations should be loaded.

optional
order: [P in keyof Entity]?:
| "ASC"
| "DESC"
| 1
| -1

Order, in which entities should be ordered.

optional
cache: boolean | number | { id: any; milliseconds: number; }

Enables or disables query result caching.

optional
lock: { mode: "optimistic"; version: number | Date; } | { mode: "pessimistic_read" | "pessimistic_write" | "dirty_read"; }

Enables or disables query result caching.

optional
loadRelationIds: boolean | { relations?: string[]; disableMixedMap?: boolean; }

If sets to true then loads all relation ids of the entity and maps them into relation values (not relation objects). If array of strings is given then loads only relation ids of the given properties.

optional
loadEagerRelations: boolean

Indicates if eager relations should be loaded or not. By default they are loaded when find methods are used.