I’m currently developing a node js cli tool to do some random stuff for work. Up until this point, my whole app was designed as a cli without any intention to use its functionality somewhere else. Now some of my collegues like to work with a ui instead of a cli so I decited to build a vue web app
Tag: node.js
Build a function that returns events that are currently happening in the present within a selected time frame in NodeJs
I am fairly new in NodeJS, and I am trying to build an event management system where the user can see events that are happening now, upcoming events and past events. I have built a model called events which has attributes startDate and endDate which a user selects upon creation of an event. I need to list eve…
How to query based on a field in a referenced document in mongodb
I have two MongoDB collections. First is Products, and the seconds is Users. The product documents has a field ownerId which refers to the users collection and the user has a Boolean field isActive. What I want to do is to find all the products where their users are active using Mongoose method collection.fin…
Why do async await and Promise.all have the same running time?
I have created three Promises as follows and awaited them, expecting them to take 6000 milliseconds: But, I have received an unexpected console message as follows. As I know, each await has 2000ms of running time. But, It doesn’t. In this case, what is the difference between my code above using async/aw…
Google Maps API using Node.js and Express
i have an idea for a website that takes in ufo information from a certain API. i have been able to display information such as the location of the encounter. the API also returns coordinates of the encounters and i want to display a map with a marker of said location. the only way I’m able to obtain the…
App worked on VSCode but didn’t after deployed to Lambda, no error in CloudWatch
I have this piece of code that runs perfectly fine locally. But after I deployed it to AWS Lambda, it didn’t execute as expected, plus, it did not print any errors to CloudWatch for me to see what had happened. I assume that it was because of the async/await that caused it but it seems to be correct. Di…
Delete function successful but returnin catch err message | Node .js [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 4 months ago. Improve this question i ha…
Mongo Organize by object inside aggregate request
My project is in nodeJs with express and i use mongoose for the request to my database mongoDb. I have a model Media the structure is: Like you seen there is a field date, imagine that i have 3 medias on differents month: I want to output something like this: Is found the property aggregate but i don’t …
How to access data-state in div id, cheerio node js
I am grateful to everyone who participates and will help a newbie. Task: Access div = client-state, then div = Here-Goes-Some-Div-ID and return json from data-state. I managed to refer to div = client state like this – Unfortunately, I did not find information on how to further access the “Here-Go…
How can I detect if a var was passed and then block it from passing again?
I have a quick question, My project is a quick 4 option answers, With radio buttons and pictures displayed, Now I have the pictures and the answers stored in a text file, That way my JS detects what it reads and then passes it to HTML, Now I use this function to pick a random line: Now How would I