The embedded interpreter is used in all sorts of different ways, including for Map/Reduce, db.eval, and $where clauses. One nice feature supported by MongoDB is the ability to store JS functions on the server.
M.D.: We wanted the shell to be a full programming environment, a “real” programming language. That makes a lot of administrative tasks much easier. It also allows us to use it for automated testing and a wide variety of other use cases.
Q: What is one cool thing it can do?
M.D.: The shell can do a lot of cool things – it’s a full MongoDB client! It can be used to perform any of the operations supported by any of the other MongoDB rivers, and you can do them from a nice REPL. This makes it incredibly easy to use for administration and just playing around with MongoDB.
M.D.: Yeah I think those are comparable. The really nice thing about the shell compared to other DB shells is that it is really a fully functioning programming language. You can do all sorts of interesting things by leveraging that fact – you can write real programs to do administrative tasks.