Upserts to MongoDB in caching.