I am modifying an object with beforeSave trigger with this code.
Moralis.Cloud.beforeSave("Notifications", async function(request) {
let dappQuery = new Moralis.Query("Channels");
dappQuery.equalTo("channelId", request.object.get("ChannelId"));
let dapp = await dappQuery.first();
let channelDetails = dapp.get("details");
request.object.set("channel", channelDetails);
return request.object
});
But it is creating two entries in the Channels collection with confirmed=True and confirmed=False.
Please let me know how can I have a single entry only.