Utils
Writing to mongo