Saving events to MongoDB