where()

Add a basic where clause to the query.


Usage

import { useRepo } from 'pinia-orm'import User from './models/User'const userRepo = useRepo(User)console.log(userRepo.where('prename', 'John').get()) // User[] - with prename 'John'// with value closureconsole.log(useRepo(User).where('votes', (value) => {  return value >= 100}).get())// with where closureconsole.log(userRepo.where((user: User) => {  return user.votes >= 100 && user.active}).get()) // User[]

Typescript Declarations

function where(  field: WherePrimaryClosure | string,  value?: WhereSecondaryClosure | any,): Query