Skip to content

Tag: node.js

mongodb .find elements in an array

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: …

How can i create a directory using Node.js?

how can i write the name and the path of my directory that i will to create in the same node command, like this and remove the path in my script > node ./stack/create.js ./path/folderName i´m trying to create a directory with this script but i want to remove const path in my script and set the path and nam…