Hi,
Is it possible to update the query object? I’d like to have one object to just keep track off-chain the id of the last created nft. So I thought I would create like a counter for that in DB.
But it looks like you cannot update the query object and I don’t want to create a new one.
const ERC1155Ids = Moralis.Object.extend("ERC1155Ids");
const query = new Moralis.Query(ERC1155Ids);
query.equalTo('objectId', 'JZzg9ec5BT9L31D5jcmMZHAZ');
const result = await query.first();
if (result) {
let erc1155Ids = await result.get('id');
console.log("Before: ", erc1155Ids);
result.set('id', ++erc1155Ids)
console.log("After: ", erc1155Ids);
await result.save();
}
console log is like it should be:
Before: 0
After: 1
But it doesn’t update the object in DB at all