Hi, I encountered a problem after creating new Moralis server on Goerli. Previously I’ve been using Rinkeby and everything was working smoothly.
I hava a pretty simple cloud function:
Moralis.Cloud.define('depositsData', async request => {
const { token } = request.params
if (token !== 'Banana' && token !== 'Zug') {
return null
}
const query = new Moralis.Query('Deposit')
const pipeline = [
{
group: {
objectId: '$token',
depositedAllTime: {
$sum: '$amount',
},
},
},
]
const results = await query.aggregate(pipeline, { useMasterKey: true })
const result = results.find(el => el.objectId === token)
return result || { depositedAllTime: 0 }
})
I also have these rows in my database:
The problem is that depositedAllTime is always 0, like so:
It worked perfectly before, but suddenly stopped after creating new instance on Goerli. I don’t think that it’s related to testnet change, but don’t really have an idea what could be the cause.
Does anyone have any idea what could I do?