In MongoDB, you don’t create “stored procedures” in the same traditional sense as in SQL databases.
However, MongoDB provides the ability to store JavaScript functions on the server side, which can offer functionality somewhat similar to stored procedures.
Here’s an example:
```
db.system.js.save({
_id : “mySimpleProcedure” ,
value : function (x, y){
return x + y;
}
});
```
You can then call this procedure within a query like this:
```
db.eval(“mySimpleProcedure(3,5)”)
```
The `db.system.js.save function` saves the JavaScript function on the MongoDB server. Then you can use `db.eval` to execute the function.
Please keep in mind that `db.eval` is deprecated since version 3.0, due to performance issues. Although MongoDB’s execution of JavaScript can be useful, frequent or complex use can cause performance problems. If you need to write a lot of database logic, you should consider a more advanced approach to structuring your data and application instead of using server-side JavaScript.