public function getUpdate()
    {
        $update = [];

        foreach ($this->update as $field => $data) {
            list($type, $value) = $data;

            if (! isset($update[$type])) {
                $update[$type] = [];
            }

            $update[$type][$field] = $value;
        }

        if ($this->atomic) {
            $update['$atomic'] = 1;
        }

        return $update;
    }