MongoDB stored procedures NOT in javascript -
i have collection , want perform action on every insert collection. problem code, actions in java. in oracle possible wrap java or c code pl/sql procedure, , use procedure in trigger. in couchdb write view. what closest analog mongodb? best possibility can think of wrap code rest server, , interact using stored javascript.
i've seen this question, due dependency on java libs, can't use javascript in workflow, neither don't want run new heavy service along mongodb if there other way this.
there number of things request:
i have collection , want perform action on every insert collection.
1) you're asking here not "stored procedure", "database trigger". mongodb not provide sort of "database trigger" functionality.
this consistent general design goals of mongodb, provide fast, scalable data store without heavy weight of traditional dbms systems. see presentation more details design goals of mongodb: http://www.10gen.com/presentations/mongosf2011/whymongodb
2) if there data processing you'd perform on every insert, you'll need on client side of mongodb connection. involve writing code in application.
3) i'd suggest avoid running javascript within mongod server if @ possible. javascript interpreted on server side, speed of queries affected. in addition, javascript run in mongod server single-threaded, there no concurrency of javascript execution.
i wish had better answer you.
Comments
Post a Comment