TylerBrock / mongo-hacker

MongoDB Shell Enhancements for Hackers
tylerbrock.github.io/mongo-hacker
MIT License
1.79k stars 235 forks source link

How does it work? #166

Closed zshamrock closed 7 years ago

zshamrock commented 8 years ago

Hi, Tyler. Thank you for the nice work.

Could you, please, explain how does it work, i.e. how it "injects" hacks into the mongo shell? Does mongo shell have the plugin system, and you just jack-in? Could you, please, share some technical details?

Yes, I know the source code is available, there are lots of javascript files, but how do they integrate with the official mongo shell?

Thank you.

TylerBrock commented 7 years ago

When the mongo shell starts it:

mongo-hacker overrides and redefines some of the JavaScript provided by MongoDB during the shell initialization to add and in some cases modify the original functionality.