fetch
The fetch action is used to fetch results of the specified criteria:
suppliers.lunaql
query({
from({
posts: {
fetch!;
};
});
});💡
The fetch action doesn't need to be called, as it is the default action.
You can also use fetchFirst. The fetchFirst action will return the first item in the results:
suppliers.lunaql
query({
from({
posts: {
where(["first_name", "==", "John"]);
fetchFirst!;
};
});
});This will return the first document that matches the criteria.