What is suggested way to have server-side hooks over mongodb?
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, ...
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.
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.
精彩评论