protected function truncatingSave(Collection $collection, array $generatedRow)
    {
        try
        {
            $collection->updateOne(array('_id' => $generatedRow['_id']), array('$set' => $generatedRow), array('upsert' => true));
        } catch (\Exception $e) {
            // We only truncate and retry the save if the \Exception contains this text.
            if (strpos($e->getMessage(),"Btree::insert: key too large to index") !== FALSE)
            {
                $this->truncateFields($collection, $generatedRow);
                $collection->updateOne(array('_id' => $generatedRow['_id']), array('$set' => $generatedRow), array('upsert' => true));
            }
            else
            {
                throw $e;
            }
        }
    }