SOQL Builder
Example
let qry = buildQuery(Account, fields => ({
select: [
fields.select('name'),
...fields.parent('owner').select('name', 'phone'),
fields.subQuery('contacts', subFields => {
return {
select: [
subFields.parent('createdBy').select('managerId'),
subFields.select('phone')
],
where: [
{ field: subFields.select('otherCity'), op: 'LIKE', val: '%YORK' },
'OR',
{ field: subFields.select('mailingCity'), op: 'LIKE', val: '%YORK' }
]
}
})
],
where: [
{ field: fields.select('name'), op: '=', val: 'Acme' }
],
orderBy: { field: fields.select('rating'), order: 'DESC' },
limit: 5,
offset: 5
});Last updated
Was this helpful?