views:

149

answers:

1

I am new to NOSQL world and still comparing between nosql and sql databases,
I Just tried making few samples using mongodb.

I am asking about stored procedures when we send few parameters to one stored procedure and this procedure execute number of other stored procedures in the database, will get data from stored procedures and send data to others.

In other words, will make the logic happen on the database side using sequence of functions and stored procedures.

Is that behavior or something the same already exist on NOSQL databases, or its completely different and i am thinking in the wrong way?

+3  A: 

Mongo uses stored Javascript in a few places including Map/Reduce, db.eval and where clauses. Checkout this blog post for a survey:

Working With Stored JavaScript in MongoDB

The key to storing your functions on the server and making them available in these three contexts is db.system.js.save:

db.system.js.save( { _id : "foo" , value : function( x , y ){ return x + y; } } );

More details in the Mongo docs

Ryan Cox