First work on function fields for mongodb backend

This will enable `fields.function()`for mongodb. The store procedure with triggers are not working for now.