mongoolia
mongoolia copied to clipboard
_algoliaObjectID is not being returned
I noticed that "_algoliaObjectID" is not being returned when I query my model. I need to know its ID to update it on Algolia when I update my local db. How can I achieve that?
p.s. When I update my db using methods like findOneAndUpdate() or findByIdAndUpdate() it simply doesn't update any data on Algolia
could you give the code you are using now?
To update my db model I use
Ad.findByIdAndUpdate(req.params.id, req.body, {new: true}).then((response) => {
res.status(200).json(response);
}).catch(() => {
res.status(403).json({ "error": { "code": 500, "message": "Something went wrong." } })
})
My model is set up based on the "How-to" tutorial from the readme file.
Sorry, I meant a complete example that can be run directly with minimal setup.