Error: connect ETIMEDOUT when scraping
问题 I have a function that: 1. gets an array of 3000 'id' properties from mongoDB documents from collection foo . 2. Creates a GET request for each ID to get 'resp' obj for id, and stores it in another database. router.get('/', (req, res) => { var collection = db.get().collection('foo'); var collection2 = db.get().collection('test'); collection.distinct('id', (err, idArr) => { // count: 3000+ idArr.forEach(id => { let url = 'https://externalapi.io/id=' + id request(url, (error, response, body) =>