I can't seem to get 'explain' to work with Node.js driver (using latest)

Keeps saying undefined. I’ve tried to a bunch of ways to write it, such as:
db.collection(mycollection).explain().aggregate(pipeline) but no love.

Check this link

How to use explain( ) in Node

Thank you for the link,must have missed it searching.

It finally triggers explain but now I get this error -

MongoInvalidArgumentError: Option "explain" cannot be used on an aggregate call with writeConcern at new AggregateOperation... :man_shrugging:t5:

Check these

“explain” cannot be used on an aggregate call with writeConcern

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.