Query.where constructor
Make a very simple query with a single Where statement.
For example Query.where('id', 1)
.
limit1
adds a limit param when true
. Defaults to false
.
Implementation
factory Query.where(
String evaluatedField,
dynamic value, {
Compare? compare,
bool limit1 = false,
}) {
compare ??= Where.defaults.compare;
return Query(
where: [Where(evaluatedField, value: value, compare: compare)],
providerArgs: {
if (limit1) 'limit': 1,
},
);
}