Watch keynotes and sessions from, our virtual developer conference.

Node.js callback with MongoDB

I am having problems with this code

const db = mongoskin.db('mongodb://@localhost:27017/test')
const id = mongoskin.helper.toObjectID

Node.js POST method'/collections/:collectionName', (req, res, next) => {
    pino(req,res);'pino output');
    req.collection.insert(req.body, {}, (e, results) => {
      if (e) return next(e)

I was looking at insert documentation but I am struggling to understand .ops.
Whee does it come from?

ops is the insertWriteOpResult object’s property. The results in the code res.send(results.ops) refers to insertWriteOpResult.