I\'m evaluating the porting of SQL Server database to MongoDb.
The problem is moving stored procedures, I read about MongoDb stored JavaScript and I would like make
I think you can use this way to run a stored script:
var cmd = new JsonCommand("{ eval: \"test_function(2)\" }"); var result = db.RunCommand(cmd);
But result is in BsonDocument to get the correct result you can use this methods:
BsonDocument
var intResult = result["retval"].ToInt32();