Hi there, I have been trying to add a new objects to a database class I just made but every time I try to connect to the db and add things I get the following error:
Error: Object not found.
at /moralis-server/lib/Controllers/DatabaseController.js:615:17
at processTicksAndRejections (node:internal/process/task_queues:96:5)
or from my local cmdline:
FailureParseError: 101 Object not found.
My database class has no permissions set on it and returns data when I query it so I at least know those aren’t the issue. Any idea on why this might be happening?
Code
const data = require('./out.json')
const Moralis = require('moralis/node')
const serverUrl = "https://......."
const appId = "........"
Moralis.start({serverUrl, appId})
const TokenClass = Moralis.Object.extend("CoinGeckoTokens");
let element = data[1]
console.log(element)
let token = new TokenClass();
if (element.id && element.symbol && element.name) {
token.set("id", element.id);
token.set("symbol", element.symbol);
token.set("name", element.name);
token.save({useMasterKey:true}).then((_) => {
console.log("Success");
}, (error) => {
console.log("Failure" + error);
})
}