some mongo changes

user functions to mongo