delete
The delete action is used to delete documents:
users.lunaql
query({
from({
users(_id: 336898764327514112) {
delete!;
};
});
});This will delete a user document with the _id of "336898764327514112".
You can also define a condition:
users.lunaql
query({
from({
users: {
where(["last_activity_at", "<", 2020]);
delete!;
};
});
});This will delete all users who have not logged in since 2019.
You can also use the softDelete action to soft delete document:
users.lunaql
query({
from({
users: {
where(["last_activity_at", "<", 2020]);
softDelete!;
};
});
});