Reputation:
What's the point of using the driver and JavaScript if we can perform the same query operations a lot easier from the Mongo shell?
Upvotes: 1
Views: 107
Reputation: 8635
In theory any piece of code can as well be achieved through a good shell.
So, why we actually stay away from shell at all cost?
Briefly, imagine shell command as a User Interface for administrators. It might be powerful enough for a task, but being a developer you would like to pass this middle-man and communicate directly with the server.
Upvotes: 1
Reputation: 39477
If you program in a certain language (say Java), it's much easier to use the Java driver to access MongoDB rather call the mongodb shell from Java, and execute commands to MongoDB this way (from the shell). The same applies for the JavaScript language and the NodeJS JavaScript host environment in particular. That's why using a driver makes sense.
Actually this whole thing applies not just to MongoDB but to relational databases too (like MySQL, Oracle, etc.).
Upvotes: 1