2

MongoDB performs really well compared to our hacking of MySQL in de-normalized way. After database migration, I realized that we might need some server-side procedures to invoke after/before database manipulation. Some sorta 3-tier architecture. I am just wondering the possible and easy way to prototype it. Are there any light server-side hooks for mongodb, just like server-side hooks for svn, git?

ex, post-commit, pre-commit, ...

Drake Guan
  • 14,514
  • 15
  • 67
  • 94
  • Why do you need this? You can write stored functions in javascript for MongoDB. See http://dirolf.com/2010/04/05/stored-javascript-in-mongodb-and-pymongo.html – TTT Jun 08 '11 at 08:33

2 Answers2

2

No, there are no features currently available in MongoDB equivalent to hooks or triggers. It'd be best to handle this sort of thing from within your application logic.

Chris Fulstow
  • 41,170
  • 10
  • 86
  • 110
0

FWIW, one of the messages in the web UI seems to imply that some hooks do exist ("adding sharding hook to enable versioning and authentication to remote servers"), but they might be only avilable within the compiled binaries, not to clients.

FGM
  • 2,830
  • 1
  • 31
  • 31