Updates many models.

@return Collection
190821
public function updateMany(): Collection
	{
		$collection = new Collection();

		foreach ($this->getInput() as $item) {
			$repository = clone $this;
			$repository->setInput($item);
			$collection->add($repository->update($repository->getInputId()));
		}

		return $collection;
	}
560055
public function records()
    {
        $recs = $this->get('recLoadAll');

        $records = array_get($recs, 'response.recs.objs');

        $all = new Collection();

        foreach ($records as $record) {
            $id = (int) $record['rec_id'];
            $model = new Record($this->client, $id, $this, ['recLoad' => $record]);
            $all->put($id, $model);
        }

        return $all;
    }
653140
protected function update()
    {
        $this->preUpdate();
        $this->data = $this->api->update($this->id, $this->data);
        $this->postUpdate();

        return $this;
    }
23906
public function loadChildren()
    {
        $loader = new CollectionLoader([
            'logger'  => $this->logger,
            'factory' => $this->modelFactory()
        ]);
        $loader->setModel($this);

        $loader->addFilter([
            'property' => 'master',
            'value'      => $this->id()
        ]);
        $loader->addFilter([
            'property' => 'active',
            'value'      => true
        ]);

        $loader->addOrder([
            'property' => 'position',
            'mode'     => 'asc'
        ]);

        return $loader->load();
    }
38284
def update_many(self, **kwargs):
        
        db_objects = self.get_dbcollection_with_es(**kwargs)
        return self.Model._update_many(
            db_objects, self._json_params, self.request)
363099
public function collections()
    {
        if (!$this->collections) {
            $this->collections = [];

            /** @var \record_adapter $record */
            foreach ($this as $record) {
                if (! isset($this->collections[$record->getBaseId()])) {
                    $this->collections[$record->getBaseId()] = $record->get_collection();
                }
            }

            $this->collections = array_values($this->collections);
        }

        return $this->collections;
    }
422523
public function makeAllSearchable()
    {
        $this->chunk(100, function (Collection $models) {
            $models = $models->map(function (Searchable $model) {
                $model->setSearchableAs($this->searchableAs());
                $model->setClassMetaData($this->getClassMetadata());

                return $model;
            });

            $this->searchableUsing()->update($models);

            event(new ModelsImported($models));
        });
    }
324520
public function getAll()
	{
		$collection = new Collection;

		$keys = $this->database->keys($this->namespace.':*');

		foreach ($keys as $key)
		{
			list($namespace, $name) = explode(':', $key);

			if ( ! $collection->has($name))
			{
				$collection->put($name, $this->get($name));
			}
		}

		return $collection;
	}
93658
public function actionCollection()
    {
        Yii::$app->response->format = Response::FORMAT_JSON;
        $source = $this->findModel(Yii::$app->request->post('model_id'));
        if (($collect = ArticleCollection::find()->where(['model_id' => $source->id, 'user_id' => Yii::$app->user->getId()])->one()) != null) {
            $collect->delete();
            return ['status' => 'unCollect'];
        } else {
            $model = new ArticleCollection();
            $model->subject = $source->title;
            $model->model_id = $source->id;
            $model->load(Yii::$app->request->post(), '');
            if ($model->save() === false && !$model->hasErrors()) {
                throw new ServerErrorHttpException('Failed to update the object for unknown reason.');
            }
            return ['status' => 'collected'];
        }
    }
373228
protected function rawCollection(): Collection
    {
        $conn = $this->connPool->getConnection();
        $database = $conn->defaultDatabase;

        return $conn->getRawConnection()->$database->{$this->collection};
    }
501472
public function index()
    {
        $model = $this->modelFullName;
        $collection = $model::all();
        if($collection->isEmpty()) throw new NotFoundException('There Are No Resources Named "' . $this->getResourceName() . '" Yet');
        return $collection;
    }
198087
public function process()
    {
        $this->data = array_values($this->data);

        if (isset($this->data[0])) {
            $data = $this->data;
        } else {
            $data = [$this->data];
        }

        foreach ($data as $key => $value) {
            $model = $this->fill($key, collect($value));
            $this->collection->push($model);
        }

        return $this->collection;
    }
443196
public function newCollection(array $models = [], string $eloquent = null, string $table = null)
    {
        return (new AccioCollection($models))->setModel($eloquent, $table);
    }
628204
public function update()
    {
        $query = 'update '.$this->getTables($this->tables).' set ';
        //
        for ($i = 0; $i < Collection::count($this->sets); $i++) {
            if ($i < Collection::count($this->sets) - 1) {
                $query .= $this->sets[$i].',';
            } else {
                $query .= $this->sets[$i];
            }
        }
        //
        $query .= ' '.$this->where;
        //
        $this->reset();
        //
        return Database::exec($query);
    }
618329
public function refresh()
    {
        $data = $this->collection
            ->getMongoCollection()
            ->findOne(array(
                '_id' => $this->getId()
            ));

        $this->replace($data);

        $this->operator->reset();

        return $this;
    }
101032
public function applyCriteria()
    {
        // if we're ignoring criteria, the model must be remade without criteria
        if ($this->ignoreCriteria === true) {

            // and make sure that they are re-applied when we stop ignoring
            if ( ! $this->activeCriteria->isEmpty()) {
                $this->makeModel();
                $this->activeCriteria = new Collection();
            }
            return $this;
        }

        if ($this->areActiveCriteriaUnchanged()) return $this;

        // if the new Criteria are different, clear the model and apply the new Criteria
        $this->makeModel();

        $this->markAppliedCriteriaAsActive();


        // apply the collected criteria to the query
        foreach ($this->getCriteriaToApply() as $criteria) {

            if ($criteria instanceof CriteriaInterface) {

                $this->model = $criteria->apply($this->model, $this);
            }
        }

        $this->clearOnceCriteria();

        return $this;
    }
1220257
public function copy(): Collection
    {
        $items = $this->items;
        $resolver = $this->resolver;

        return new static($items, $resolver);
    }