@ Override public ClosableIterator < Tuple > callStoredProcedure ( String storedProcedureName , ProcedureQueryParameters params , TupleContext tupleContext ) { validate ( params ) ; StringBuilder commandLine = createCallStoreProcedureCommand ( storedProcedureName , params ) ; Document result = callStoredProcedure ( commandLine ) ; Object resultValue = result . get ( "retval" ) ; List < Tuple > resultTuples = extractTuples ( storedProcedureName , resultValue ) ; return CollectionHelper . newClosableIterator ( resultTuples ) ; }
In MongoDB the equivalent of a stored procedure is a stored Javascript .