I have the next function using firebase in an JavaScript app. The query works fine the first time because lastDoc isn’t defined so it gets the first 7 documents in the database, but the next time when there’s a lastDoc, the query keeps returning the same first 7 docs. The lastDoc variable is updated and indeed gets the value of
Tag: database
Impossible to connect to postgres with typescript
I’m trying to connect into a postgresSQL database in typescript and to be faire, it doesn’t work and it’s not explicite why. I do not have any error log output and so after trying to use manually some console.log to debug. I found that the method connect seem to timeout or fail I don’t know since I do not have
My imported component seems to not be taking in my state values
here I want to invoke the MineralOutput component after the submit button and pass in the age, gender, and userid with state. This is the component that I imported. When I click the submit button, I get a 404 status code error. I’m using Axios for requests and it has already worked before when I wanted to post inside a
Mongoose how to count unique days in a month?
i am working on a problem where in my database there supposed to be multiple entries from day to day. each entry includes a timestamp. the problem is im supposed to find how many days in each month a data has been entered. ex: if a user sends a message every 2 days in may. my answer would be: “the
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
knex migration – ‘ER_INVALID_DEFAULT: Invalid default value for ‘timestamp’
I have a knex chema migration to create a table, with the line – I am getting an error ER_INVALID_DEFAULT: Invalid default value for ‘timestamp’ I’ve tried to give a default of null and remove the notNullable() or a default of CURRENT_TIMESTAMP but nothing seems to work (maybe I have a wrong syntax?) I’d appreciate any help! Answer If you
Error and blank page on Vue JS when creating a json file in assets
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
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