PageSourceSearch

https://kysely.dev/assets/js/5807aa1d.4ec51820.js

js kysely.dev collected 2026-10-02 02:59:01 UTC 2,743 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkkysely_site=globalThis.webpackChunkkysely_site||[]).push([[9134],{2543(e,t,s){s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>a,default:()=>u,frontMatter:()=>o,metadata:()=>r,toc:()=>h});const r=JSON.parse('{"id":"examples/where/object-filter","title":"Object filter","description":"You can use the and function to create a simple equality","source":"@site/docs/examples/where/0030-object-filter.mdx","sourceDirName":"examples/where","slug":"/examples/where/object-filter","permalink":"/docs/examples/where/object-filter","draft":false,"unlisted":false,"editUrl":"https://github.com/kysely-org/kysely/tree/master/site/docs/examples/where/0030-object-filter.mdx","tags":[],"version":"current","sidebarPosition":30,"frontMatter":{"title":"Object filter"},"sidebar":"tutorialSidebar","previous":{"title":"Where in","permalink":"/docs/examples/where/where-in"},"next":{"title":"OR where","permalink":"/docs/examples/where/or-where"}}');var i=s(1058),n=s(4801),l=s(2360);const o={title:"Object filter"},a="Object filter",c={},h=[];function d(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",header:"header",li:"li",p:"p",ul:"ul",...(0,n.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"object-filter",children:"Object filter"})}),"\n",(0,i.jsxs)(t.p,{children:["You can use the ",(0,i.jsx)(t.code,{children:"and"})," function to create a simple equality\nfilter using an object"]}),"\n","\n","\n",(0,i.jsx)("div",{style:{marginBottom:"1em"},children:(0,i.jsx)(l.Q,{code:"const persons = await db\n  .selectFrom('person')\n  .selectAll()\n  .where((eb) => eb.and({\n    first_name: 'Jennifer',\n    last_name: eb.ref('first_name')\n  }))\n  .execute()"})}),"\n",(0,i.jsxs)(t.admonition,{title:"More examples",type:"info",children:[(0,i.jsxs)(t.p,{children:["The API documentation is packed with examples. The API docs are hosted ",(0,i.jsx)(t.a,{href:"https://kysely-org.github.io/kysely-apidoc/",children:"here"}),",\nbut you can access the same documentation by hovering over functions/methods/classes in your IDE. The examples are always\njust one hover away!"]}),(0,i.jsx)(t.p,{children:"For example, check out these sections:"}),(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#where",children:"where method"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#whereRef",children:"whereRef method"})}),"\n"]})]})]})}function u(e={}){const{wrapper:t}={...(0,n.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.