I have an array that dynamically holds document id’s, in which I need to query another collcetion in mongo to see if the id’s match. I have this code: however, doing “id”: { $in: array_of_docs_bought } doesn’t iterate through the array, so it returns nothing, but when I do this: …
Category: Questions
problem with settimeout function in slideshow speeding up after about 5 interations
The following code I have implemented for a javascript slideshow appears to speed up after about 5 iterations, from once every 15 seconds to what appears to be about 1 second between transitions. Is there something wrong with how the jquery/javascript implements the setTimeout? Thanks Answer Use setInterval i…
Copy active class from one div to another div with a corresponding data attribute value
Is there a way to toggle the class selected that is currently set on the button in .ProductItem-gallery-slides to the corresponding button in .ProductItem-gallery-thumbnails with the same data attribute? Answer Whilst I agree with Rory – I suspect there is no example code so I hope the following is what…
How can I get the updated data without refresh the page in React?
I have a component with create a blog. It works fine and navigates me to the home after adding the new blog object in the database, but I have to refresh the page to be able to see the updated data. So how can I see the updated blogs after navigation without refreshing the page? Answer In order to update
why do these similiar functions not work?
I have some divs and if i hover them I want an popup to show. I have six divs and six popups to show but not all at once instead only one per one. The first function works fine but then the other do not work how can I move them all to one snippet? Answer okay so actually i
Get all the texts in h2 and return an array readable (via APIFY)
I’m using “Web scraper apify” to scrap some data from a website. The goal is to get all the texts in H2 and return an array of them. My problem is when I returned the array. This one is not correct and not usable because it separates all the letters of the different scrapped texts. I tried t…
THREE.js collision detection and stop/move again
I have a rounded ground and there is a ball on it. trying to move the ball inside the ground with using smartphone orientation. no problem with that part. the ball is moving and make the ball stop at the edge by using three.js intersectsSphere. but couldn’t manage the move the ball again if the orientat…
JS/TS: Getting access to a value wrapped in a promise?
I have an Object where the key is a stringified object and the value is a Promise that eventually resolves to a font object. I use Promise.all to wait for them all to resolve. After this, I log the object in console and it looks like: I want to enumerate through the object to ensure each postscript name in th…
How could I replace repeated complex strings in javascript? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 months ago. Improve this question For example, the input would be: @[facts.::ip](facts.::ip) = “127.0…
Write assertion subject to whether key has value
I’m trying to come up with a method that would allow me to create a it block that confirms whether my configuration file has a specific attribute. The object has in it: I would like to have an it block that would confirm whether this value is true and if it isn’t, then it should fail. I have tried…