I went through a very strange issue. I have a vue project created with vue ui. I’m editing my code in visual studio. i want to prototype and work with fake data before connecting my API. So i had the idea to create a json file in my assets folder to host my moock datas and import them to work
Tag: database
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
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
Leaflet : How to create marker labels based on JSON fetched from API
Users are shown points to press. When clicking a point, a menu pops up with text. I’ve been able to set down points, but when I try to retrieve data from my database when clicking a point, it shows does not show the marker specific information. Where did I go wrong? I need the pointers to only show their own
ReactJS. How to sort through data and find equal value of name property to id and store the object in a variable
I have a database and I am trying to sort through the data in the database and find the one that has a name property equal to the id variable that I specified. The id variable works though I am having trouble sorting through and finding the name property equal to the id variable. This what I have tried: I
MongoDB/Mongoose – Find all where a specific Date is in a Date Range
for example I have documents with this field: startDate: 2021-04-14T22:00:00.000+00:00 endDate: 2021-04-19T22:00:00.000+00:00 and I want to get all documents where a specific date (like today) is in …
Add the sum of two fields to a new field in the document
I would like to calculate sum of two fields, then create new field in document something like: ‘totalSum’. But I dont know how to do this. All in mongodb. Here’s an example: const obj = { …
mongodb project map fields to return from query with wildcard
I’m working on a system where I use a schema with the type Map much like this: const Product = mongoose.model(‘Product’, { name: String, data:{ type:Map, of:String } }); I’…
Firebase and JavaScript: Update fetched data on website from real time database without reloading website [closed]
I want to deploy a website to Firebase. The website has to fetch data from the firebase database. If the values from the database has been updated I want that the fetched data on the website will be …
Uncaught TypeError: Cannot read property ‘collection’ of null
I’ve been trying to get data out of a collection, but it returns me Uncaught TypeError: Cannot read property ‘collection’ of null. The Mongo database itself is connected with the cloud and checking …