0

Is that true, that MongoDB shell is written in JavaScript?

If yes why it's a UNIX binary? Not a webapp for browser?

> less /usr/local/bin/mongo                            
"/usr/local/bin/mongo" may be a binary file.  See it anyway?       
> file /usr/local/bin/mongo                            
/usr/local/bin/mongo: Mach-O 64-bit executable x86_64
4
  • 4
    The mongo shell accepts JavaScript code. What makes you think it is implemented in JavaScript? This is like thinking the bash shell (which is implemented in C) was implemented in bash script... Commented Jun 19, 2015 at 18:16
  • 2
    Furthermore, Javascript runs on UNIX outside the browser as well... Commented Jun 19, 2015 at 18:20
  • Never heard of nodejs? Look into it. Commented Jun 20, 2015 at 6:13
  • @fyodor78 Maybe you should learn from the pros university.mongodb.com - free, packed with information, and done by the vendor. You can't ask for more. Commented Jun 20, 2015 at 23:01

1 Answer 1

2

The mongo shell, as well as the mongod database process are implemented in C++. You can get the source code and build it yourself here: https://github.com/mongodb/mongo

Sign up to request clarification or add additional context in comments.

2 Comments

This is not true! For instance, this is the implementation of the .count() method: github.com/mongodb/mongo/blob/master/src/mongo/shell/… - JavaScript! You will see the same when you enter this in the mongo shell: db.myCollection.find().count
@nexus, most of the API is written in JavaScript, but the shell that runs those functions is written in C++.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.