Arquisoft / radarin_en3a

2 stars 1 forks source link

Database and restApi research #27

Closed irenebello closed 3 years ago

irenebello commented 3 years ago

How to work with mongoDB and what can we find in the restApi folder

irenebello commented 3 years ago

In the models package we add all the models (entities) of things we are going to save in the database. In the Api.js we put how the database has to change whith the http methods post and get. Here is were we are going to put the methods to save the locations and so own. In Server.js we have everything we need for the connection with the database. To test the datavase we will need postman. To enter the database we need to have something downloaded if we want to see it, we can start this with docker or without docker doing npm start in the /restapi. The docs of the mongo db are here :https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/#run-mongodb-from-cmd this is the docs to instal mongodb on windows. We also need to use mongoose in here to work properly with the database.

uo270411 commented 3 years ago

I found a very interesting tutorial about using mongodb and mongoose. It explains how to create different elements in the database and how to access and interact with them. https://developer.mozilla.org/es/docs/Learn/Server-side/Express_Nodejs/mongoose