// Object form - simple conditions
where({ status: 'active' })
// => { status: 'active' }
// Object form - with operators
where({ age: { $gte: 18 }, status: 'active' })
// => { age: { $gte: 18 }, status: 'active' }
// Three-argument form
where('age', Op.gte, 18)
// => { age: { $gte: 18 } }
// Nested OR
where({ OR: [{ status: 'active' }, { role: 'admin' }] })
// => { $or: [{ status: 'active' }, { role: 'admin' }] }
// Nested AND
where({ AND: [{ age: { $gte: 18 } }, { status: 'active' }] })
// => { $and: [{ age: { $gte: 18 } }, { status: 'active' }] }
Helper to create where conditions Supports multiple call signatures:
// Object form - simple conditions
where({ status: 'active' })
// => { status: 'active' }
// Object form - with operators
where({ age: { $gte: 18 }, status: 'active' })
// => { age: { $gte: 18 }, status: 'active' }
// Three-argument form
where('age', Op.gte, 18)
// => { age: { $gte: 18 } }
// Nested OR
where({ OR: [{ status: 'active' }, { role: 'admin' }] })
// => { $or: [{ status: 'active' }, { role: 'admin' }] }
// Nested AND
where({ AND: [{ age: { $gte: 18 } }, { status: 'active' }] })
// => { $and: [{ age: { $gte: 18 } }, { status: 'active' }] }
Helper to create where conditions Supports multiple call signatures: