I decided to use MongoDB for building my blog. As I have never worked with MongoDB before, I still have to figure out how to get everything to work. So, the only thing left to do now is getting started with MongoDB. How do we set it up, add users, and create our database.
First, lets download the community server which is free and open source. I will be using the Windows version for my desktop and this article. After installing the software, I also installed mongosh since I am an avid command line user. After adding mongosh to my PATH variablesIt is halfway when trying to boot the server again, that I figured that using mongosh might not have been the brightest of ideas. MongoDB is already new to me and using beta software that does not support all commands yet is not making things any easier. So, I switched to the legacy mongo shell, since the documentation is up to date for that. I managed to boot the server again and logging into my database!Creating a Database
I got my authentication ready, the final step now is to create a database. You can easily create a new database in MongoDB with the use command. If the database doesn't exist yet, it creates it. Keep in mind though that MongoDB will save the database only when you put data in it. Until then, it is not saved and does not show up when using the show dbs command.
With MongoDB running on my desktop, I can finally start with a little proof of concept. I will use that proof of concept to figure out how to connect to MongoDB and add my first set of data using Spring Boot. That should allow me to get a better grip on the technologies to start implementing it for the actual project. You know... less hacky and a bit more clean. However, that is for another post!
Top comments (0)