I am newbie to mongodb (java).
I need to execute list of commands(queries in relational) by using something similar to procedures in relational db.
Is it possible in mongodb?
I am newbie to mongodb (java).
I need to execute list of commands(queries in relational) by using something similar to procedures in relational db.
Is it possible in mongodb?
MongoDB has no real sense of stored procedures. It has server side functions however these functions:
However you can achieve it with
$where
oreval
ing an actual function name withinsystem.js
. But then these actually don't run "server-side".Using a
exec
type command in your app to call the shell won't be a good idea either. The script files you run in shell are as much client side as your own app so that's just pointless.MongoDB also does not allow triggers however they are within the JIRA: https://jira.mongodb.org/browse/SERVER-124 but are not scheduled. You will need to place triggers on client side within your coding.
NoSQL is not relational. You might want to read up on how to design a proper schema for MongoDB, here is a starting point: http://www.mongodb.org/display/DOCS/Schema+Design. This will teach you the essence of MongoDB and how to choose the right structure.
You can create server-side javascript functions, yes. But I advise against it, because it's will be
Read more: http://www.mongodb.org/display/DOCS/Server-side+Code+Execution#Server-sideCodeExecution-Storingfunctionsserverside