ISODate() that is not compatible with JSON.
If so, the solution is to convert shell output into MongoDB Extended JSON which has JSON-compatible representations of all BSON data types.
For example, using
test> dt = new Date()
If you want to convert
db.currentOp() output into Extended JSON for use with standard libraries:
mongosh --eval "EJSON.stringify(db.currentOp())" --quiet
--quiet option suppresses startup messages (for example, version info or startup warnings) so output should only include results of the