public function set($name, $data = [])
    {
        if (!is_array($name) || (isset($name[0]) && is_string($name[0]))) {
            $this->setAt($name, $data);
            return $this;
        }
        $data = $name;
        if (!is_array($data)) {
            throw new ORMException('Invalid bulk data for a document.');
        }
        foreach ($data as $name => $value) {
            $this->setAt($name, $value);
        }
        return $this;
    }