saving object works in mongodb