#Data Not Found
16 messages · Page 1 of 1 (latest)
Can you share some code of where you either fetch data or make new documents?
That just makes the model. In order to make a document you need to do something along the lines of:
const model = require('model path');
await model.create({ ... }).save();
iirc
Ok, so you catch any error and return
That's not gonna catch anything
if you do
const data = await Data.save();
console.log(data);
what does data log
wdym where? Where you do await Data.save() obviously
Ok so there's your document
Is it fetching that's the problem?
#how-to-get-help "don't working" won't help
again, you catch and return so if it errors you don't log anything
logging things helps too
data is still a promise, so you’ll need to await it
And .catch(() => {}) is a bad practice. Log your errors, especially if things “don’t work”
And now it doesn’t. And if it errors you wouldn’t even know…