Open utterances-bot opened 2 years ago
If anyone is following this in 2022, be aware that the default behavior for Mongoose since version 4.0 is to return the old record after a findByIdAndUpdate operation. You must now specify to use the new record:
let result = await Blog.findByIdAndUpdate(id, req.body, {new: true});
Hope this helps something! I couldn't figure out why an updated blog card wasn't re-rendering without a browser refresh, and turns out this was the reason.
Hi
BTW great work. I have additional question. I see that you are not including routes/blog.js anywhere. Is this on purpose or a mistake?
Build A Blog App with ExpressJs and SvelteJs - CodeSource.io
In this article, We will build a simple blog application with expressjs and Sveltejs. Svelte makes use of a new approach to building user
https://codesource.io/build-a-blog-app-with-expressjs-and-sveltejs/