1// Sort by symbol, skip the first 5, return at most 20, and don't hydrate
2// the returned doc. See https://mongoosejs.com/docs/api.html#model_Model.hydrate
3const query = Stock.find().sort({ symbol: 1 }).skip(5).limit(20).lean();
4for await (const stock of query) {
5 const price = await superagent.
6 get(`https://api.iextrading.com/1.0/stock/${stock.symbol}/price`).
7 then(res => res.body);
8 console.log(stock.symbol, price);
9 // No `save()` because `stock` is lean
10}