Skip to content

Tag: database

Connect mangoDB Atlas with nodejs

I can’t connect to MongoDB database, yet I tried everything ! I have successfully replaced the password. Here is the Database MangoDB Answer You will need another function to complete the operation. the function is usually called run then you need to write all the operations of your server in the scope of this function. here is an example of

What’s the point of using save() in Mongoose?

I’m learning MongoDB and Mongoose, and I’ve watched instructors advise to use the save() function to save the changes made to the database. But I’m still making changes successfully without using save(). I’ve made two functions to add a document to the database, one with using save() and the second one without using save(), and they all did the same

Using new collections for each user

I am building an Expense Tracking app using Node.js where all the Income and Costs should get saved in a database. My idea is to create a new collection for each registered user and save all their income/cost actions in that collection. The things i would like to consider before writing it are: how do i name the collections Efficiency

Generate an indefinite number of charts as images (chart.js)

I would like to generate several “line charts” as an image file. For this purpose, data is requested from a database. This data is transferred to the function for chart generation separately for each line chart. At the “console.log” output at the beginning of the function, the transferred data is correctly displayed. If I query the same output of the