Step-by-Step Guide: Create a Next.js 13 CRUD App with MongoDB from Scratch

Step-by-Step Guide: Create a Next.js 13 CRUD App with MongoDB from Scratch

GTCoding

1 год назад

123,557 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Justin Bernard
Justin Bernard - 17.10.2023 07:29

Hello, thank you for the great video! 1 question, is it necessary to call "await connectMongoDB();" each time we make a request to the api? Thank you

Ответить
devran deniz
devran deniz - 16.10.2023 20:00

Great and very helpful tutorial...Just a quick note, in addTopic page, we can use router.replace("/") instead router.push(/) to auto refresh the routed page ..thanks so much

Ответить
Phani Murari
Phani Murari - 16.10.2023 15:02

Thank you So much brother.
Love From India 😀

Ответить
Chukwuemeka Stanley
Chukwuemeka Stanley - 15.10.2023 19:12

Quick question. Is it advisable to connect to mongo db on every request?

Ответить
Gautam
Gautam - 08.10.2023 20:02

I've to reload the home page after adding a topic, otherwise it just doesn't show up..
How to fix this ?

Ответить
Badis
Badis - 07.10.2023 15:42

I recommend showing us how to add pagination

Ответить
Heart Blanco
Heart Blanco - 04.10.2023 15:47

What extension you are using?

Ответить
Madan M Malhotra
Madan M Malhotra - 25.09.2023 16:01

it is necessary to close the mongo connection after request complete

Ответить
Davi Cardoso
Davi Cardoso - 23.09.2023 04:00

You are the guy!!! thanks a lot bro.

Ответить
Jan Carlos Castañares Zemelka
Jan Carlos Castañares Zemelka - 22.09.2023 03:23

This video is fantastic man, thanks a lot ! However, does anybody know how to implement the same scenario using the Mongo Driver for Node.js?

Ответить
codeoz
codeoz - 21.09.2023 00:38

Thank you very much for the lesson. "addTopic" how could we fetch this page even though it is use client. Aren't fetch operations in Nextjs also in Server Components?

Ответить
Mario David Gutierrez
Mario David Gutierrez - 20.09.2023 23:55

I struggled for a good week to connect with my MongoDB but you made it easy and very didactic, thank you for your time and knowledge, this video is Goooold 💰

Ответить
ELIJAH ISAIAH
ELIJAH ISAIAH - 19.09.2023 23:33

Something that I have learnt without understanding a line, you just made it so easy like 'abc', thankyou very much for this amazing teaching technique. I must request a video on how I can upload images and text content to Cloudinary & MongoDB. Thank you so much

Ответить
Nadeem Symun
Nadeem Symun - 16.09.2023 19:08

Thanks for this great video.

Ответить
Basic Breakdowns
Basic Breakdowns - 15.09.2023 18:43

The GET method is not working 🥲🥲🥲 Please help!

TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11576:11)

at connect (C:\Users\harig\AppData\Desktop\test1\node_modules\next\dist\compiled\undici\index.js:1:65301) {
code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
}
}

Ответить
Hasnain Mazhar
Hasnain Mazhar - 12.09.2023 23:13

Can you tell me which theme are you using.? Please answer 😢

Ответить
Royan Dugu
Royan Dugu - 11.09.2023 05:32

Is this client side rendering or server side rendering ?

Ответить
ิbababa
ิbababa - 10.09.2023 15:44

at 30.20 method GET in my postman I have 500 internal server error, what's problem?

Ответить
Kumar Deepam
Kumar Deepam - 09.09.2023 23:41

Excellent tutorial mate! Your teaching style and voice reminds me of Mumshad Mannambeth of KodeCloud.

Ответить
Dr. Zalchicha
Dr. Zalchicha - 08.09.2023 00:11

Pretty good stuff! I was able to create a nice CRUD. Thanks!

Ответить
顾清
顾清 - 04.09.2023 16:39

why i use fetch in a "use client" to add a posts to db, it has a error, async/await only support in server component

Ответить
Amar Krishna
Amar Krishna - 04.09.2023 13:26

Thanks you so much for the clear and well explained tutorial

Ответить
Manuel Barreiro
Manuel Barreiro - 04.09.2023 02:44

I can add topic but I must refresh for it to show it in the main list, but in the video you don´t refresh, it just appears there after submiting post. Help please!

Ответить
Redbeardjunior
Redbeardjunior - 03.09.2023 03:02

Thank you for the course ! I;m stunning on a bug some how that after I add a new Topic with my POST route that I have to refresh the page before the item is showed that there is added a new topic.

any one else have the samen problem, or am I the only one.

Ответить
Faizal Syed
Faizal Syed - 02.09.2023 19:46

hey, your video really helped me but it also left me with one question. I tried to use the entire mongoose code (connecting, schema, creating collection) at the client side of the next js project and it didn't worked. I only managed to create a empty collection with the name i specified in the code, other than that It failed to create documents. Why did this happen? does mongoose only work at the server side ?

Ответить
Dulakshan Wijesundara
Dulakshan Wijesundara - 01.09.2023 23:15

Thank you.

Ответить
Muhammed Ulvi Özkaya
Muhammed Ulvi Özkaya - 31.08.2023 15:08

Hello, i have an error: "TypeError: undefined is not an object (evaluating '(mongoose__WEBPACK_IMPORTED_MODULE_0___default().models).Element')". I tried to use the older version of Mongoose, and downgraded it to 7.3.0 which is the one you're using in the tutorial but still couldn't solve.
Anyone has an idea?

Ответить
Hari Nair
Hari Nair - 28.08.2023 05:40

Could you make a video securing the APi with a key or authentication?

Ответить
Eliyahu Cohen
Eliyahu Cohen - 24.08.2023 17:33

Man i was so sceptical when i started watching this video but man i was wrong not watching it sooner this is just amazing thank you so much

Ответить
QT and The Climb Vault
QT and The Climb Vault - 24.08.2023 05:32

so with the newest version of the app router there might be a .map error. So I had to use: await connectMongodb();
return await Topic.find(); to fix it. Just curious why it wanted me to that instead of the first way.

Ответить
Leonardo Hurovich
Leonardo Hurovich - 23.08.2023 17:26

Very nice video! Your didatics are so good, keep it up man!

Ответить
Vellaikarthick
Vellaikarthick - 22.08.2023 04:22

TypeError:fetch failed ......?

Ответить
BallisticDog
BallisticDog - 17.08.2023 04:55

10/10 guide thank you so much

Ответить
Ernani Silva
Ernani Silva - 14.08.2023 00:01

Ola Mestre, sou do Brasil e quero agradecer por compartilhar seu conhecimento, simples e eficiente, thank you !!!!

Ответить
Krishna Kamlesh
Krishna Kamlesh - 12.08.2023 16:42

Wo very helpful great project❤❤ I have learned so much🎉

Ответить
Deepak K
Deepak K - 12.08.2023 14:57

may be this is 1 hour video but i took 3 hours to learn i shifting my carrier to js from python ... will come back soon as i create complex project i will come and post in
replay section

Ответить
Bipin Darole
Bipin Darole - 12.08.2023 14:41

HI. I keep getting "connected to MongoDB" non-stop in the logs. How do I fix this?

Ответить
Everson Junior
Everson Junior - 11.08.2023 23:52

Why did you put components out of app folder? I didn't understand why EditTop form you put in components folder and AddTopic you put in App folder.

Ответить
Vikas Sharma
Vikas Sharma - 10.08.2023 16:52

When i click on get request on postman, it is showing me error 500 internal server, what reason it is happening?

Ответить
Amar Deep Dwivedi
Amar Deep Dwivedi - 09.08.2023 12:54

This video is enough to understand crud in next js in very simple way.

Ответить
Nouman Khan
Nouman Khan - 07.08.2023 23:45

MongooseError: Can't call `openUri()` on an active connection with different connection strings. Make sure you aren't calling `mongoose.connect()` multiple times.

Ответить
Tal Zer-Aviv
Tal Zer-Aviv - 07.08.2023 17:05

In a production environment such as Vercel, what do I write instead of localhost:3000 in order to access my task list? I can call my mongoose models directly but wouldn't that beat the purpose of fetching from a local api?

Ответить
soliman said
soliman said - 07.08.2023 01:19

Bru whenn u want to add topic i can add it but i must to refresh to show it

Ответить
Ari Sudana
Ari Sudana - 06.08.2023 04:45

I have just one request, please don't stop making tutorials like this. Very helpful. Much thanks!

Ответить
ko wai sum
ko wai sum - 06.08.2023 04:31

I run the CRUD in dev fetch request works in development, but fails in build on production.

Ответить
doe
doe - 06.08.2023 00:21

Okay this is a big waste of time. You're not explaining anything. You are just writing code and saying what you're writing. It's not helpful to a learner. You haven't covered the basics of Next.js and I'm so lost! Waste of time. Label this video 'code-along' next time and not 'step-by-step' guide. Aghh I'm so angry. Dickhead!

Ответить
Ersa ix01
Ersa ix01 - 05.08.2023 04:48

TypeError: Cannot destructure property 'title' of 'topic' as it is undefined.
at EditTopic (./app/editTopic/[id]/page.jsx:30:13)
23 | }
24 | const {topic} = await getTopicById(id);
> 25 | const {title, description} = topic;
| ^
26 | return (
27 | <EditTopicForm />
28 | ).

hello i hope youre doing well, i got this error and it can't be solved i tried so many ways i get the same error idk why, the code is as same as yours it works on postman thou, but i keep seeing this error can you help me with it please. a very compelete and well explained tutorial thank you so much.

Ответить