* Specify that the query should return a single result * @returns A QueryBuilder that returns the first result * * @example * ```ts * // Get the user matching the query * query * .from({ users: usersCollection }) * .where(({users}) => eq(users.id, 1)) * .findOne()
()
| 801 | *``` |
| 802 | */ |
| 803 | findOne(): QueryBuilder<TContext & SingleResult> { |
| 804 | return new BaseQueryBuilder({ |
| 805 | ...this.query, |
| 806 | // TODO: enforcing return only one result with also a default orderBy if none is specified |
| 807 | // limit: 1, |
| 808 | singleResult: true, |
| 809 | }) as any |
| 810 | } |
| 811 | |
| 812 | // Helper methods |
| 813 | private _getCurrentAliases(): Array<string> { |
no outgoing calls