Digital Marketing

MongoDB Shell Editor Mode

Run the .editor command within the MongoDB Shell to open the editor and manage comprehensive multiline functions:

Run the following command within the MongoDB Shell:


The MongoDB Shell enters editor mode:

// Entering editor mode (^D to finish, ^C to cancel)
const { Writable } = require('stream');
const myWritable = new Writable({
write(chunk, encoding, callback) {
// ...
writev(chunks, callback) {
// ...
  • Press Cmd/Ctrl + d to finish and run your function.
  • Press Cmd/Ctrl + c to cancel and exit without running your function.

When you close the editor, the MongoDB Shell does not save any functions you had entered into the editor.


Popular posts from this blog

How to fix Google Apps Script: Script function not found: doGet

Creating sort index in MySQL

How to fix: df shows no file systems processed on Linux