my mongodb helper function