Updates a collection.
438916
public function updateCollection(Collection $collection): void
    {
        $query = $this->connection->createQueryBuilder();
        $query
            ->update('ngbm_collection')
            ->set('start', ':start')
            ->set('length', ':length')
            ->set('translatable', ':translatable')
            ->set('main_locale', ':main_locale')
            ->set('always_available', ':always_available')
            ->where(
                $query->expr()->eq('id', ':id')
            )
            ->setParameter('id', $collection->id, Type::INTEGER)
            ->setParameter('start', $collection->offset, Type::INTEGER)
            ->setParameter('length', $collection->limit, Type::INTEGER)
            ->setParameter('translatable', $collection->isTranslatable, Type::BOOLEAN)
            ->setParameter('main_locale', $collection->mainLocale, Type::STRING)
            ->setParameter('always_available', $collection->alwaysAvailable, Type::BOOLEAN);

        $this->applyStatusCondition($query, $collection->status);

        $query->execute();
    }
26603
def update(collection_name, upsert, multi,
           spec, doc, safe, last_error_args, check_keys, opts):
    
    options = 0
    if upsert:
        options += 1
    if multi:
        options += 2

    data = _ZERO_32
    data += bson._make_c_string(collection_name)
    data += struct.pack("<i", options)
    data += bson.BSON.encode(spec, False, opts)
    encoded = bson.BSON.encode(doc, check_keys, opts)
    data += encoded
    if safe:
        (_, update_message) = __pack_message(2001, data)
        (request_id, error_message, _) = __last_error(collection_name,
                                                      last_error_args)
        return (request_id, update_message + error_message, len(encoded))
    else:
        (request_id, update_message) = __pack_message(2001, data)
        return (request_id, update_message, len(encoded))
704434
def update(self, item, dry_run=None):
        """"""
        logger.debug('Updating item. Item: {item} Path: {data_file}'.format(
            item=item,
            data_file=self.data_file
        ))
        self.delete(item, dry_run=dry_run)
        return self.create(item, dry_run=dry_run)
617217
public void addCollection(Collection<? extends E> collection) {
		if (collection != null && !collection.isEmpty()) {
			this.collections.add(collection);
		}
	}
1316042
function updateCollected(err, result) {
            if (typeof result !== 'object') {
                collection.err = collection.err || new Error('Invalid acrhitect plugin format');
                return;
            }

            collection.err = collection.err || err;

            if (!collection.loaded) {
                collection.result = result;
                collection.loaded = true;
                return;
            }

            for (var i in result) {
                if (result.hasOwnProperty(i)) {
                    if (collection.result.hasOwnProperty(i)) {
                        collection.err = collection.err || new Error('Service overloading not supported: ' + i);
                        return;
                    }
                    collection.result[i] = result[i];
                }
            }
        }
773822
protected function updateCollectionItem()
    {
        $this->controlAccess('collection_item_edit');

        if ($this->collection_item->update($this->data_collection_item['collection_item_id'], $this->getSubmitted())) {
            $url = "admin/content/collection-item/{$this->data_collection['collection_id']}";
            $this->redirect($url, $this->text('Collection item has been updated'), 'success');
        }

        $this->redirect('', $this->text('Collection item has not been updated'), 'warning');
    }
20438
final public function updateCollectionObject() {
		if (!empty($this->collection_object) && !empty($this->collection)) {
			$this->collection_object->data = array_merge_hard($this->collection_object->data, $this->collection);
		}
	}
918463
def reload(self):
        """"""
        self.emit('will_reload')
        self.populate(self.collection.find_one(type(self)._id_spec(self['_id'])))
        self.emit('did_reload')
721901
protected function updateCollectionItem($collection_item_id)
    {
        if (!$this->isError() && !$this->collection_item->update($collection_item_id, $this->getSubmitted())) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }
462647
def update(self, request, _id):
        
        _id = deserialize(_id)

        to_update = self.collection.find_one({'_id': _id})
        if to_update:
            document = self.collection(dict(to_update, **request.json))
            document.updated_at = datetime.utcnow()

            updated = document.update()
            return Response(
                response=serialize(updated),
                status=(
                    200 if not all(
                        key in updated for key in [
                            'error_code', 'error_type', 'error_message'
                        ]
                    ) else 400
                )
            )
        else:
            return Response(
                response=serialize(
                    DocumentNotFoundError(self.collection.__name__, _id)
                ),
                status=400
            )
1111929
def _update_indexes_for_mutated_object(collection, obj):
    """"""
    for index in _db[collection].indexes.values():
        _remove_from_index(index, obj)
        _add_to_index(index, obj)
300821
def reload(self, *fields, **kw):
		""""""
		
		Doc, collection, query, options = self._prepare_find(id=self.id, projection=fields, **kw)
		result = collection.find_one(query, **options)
		
		if fields:  # Refresh only the requested data.
			for k in result:  # TODO: Better merge algorithm.
				if k == ~Doc.id: continue
				self.__data__[k] = result[k]
		else:
			self.__data__ = result
		
		return self
486984
def update(self, item, dry_run=None):
        """"""
        return self.backend.update(validate(item, version=self.version, context=self.context), dry_run=dry_run)
845185
def update(self, mapping):
        """"""
        return self.api.mset(dict((key, self.prepare_value(value))
                                for key, value in mapping.items()))
405316
@Override
  public <T> void updateCollectionSchema(CollectionSchemaUpdate update, Class<T> entityClass) {
    updateCollectionSchema(update, Util.determineCollectionName(entityClass));
  }
567211
protected void update() {
        int sz = dataModel.getSize();
        int[] selected = helperList.getSelectedIndices();
        ArrayList sourceItems = new ArrayList(sz);
        ArrayList chosenItems = new ArrayList(selected.length);

        // Start with the source items filled from our data model
        for (int i = 0; i < sz; i++) {
            sourceItems.add(dataModel.getElementAt(i));
        }

        // Now move the selected items to the chosen list
        for (int i = selected.length - 1; i >= 0; i--) {
            chosenItems.add(sourceItems.remove(selected[i]));
        }

        Collections.reverse(chosenItems); // We built it backwards

        // Now install the two new lists
        sourceList.setListData(sourceItems.toArray());
        chosenList.setListData(chosenItems.toArray());
    }
645949
public function newCollectionUpdateStruct(?Collection $collection = null): CollectionUpdateStruct
    {
        $collectionUpdateStruct = new CollectionUpdateStruct();

        if ($collection !== null) {
            $collectionUpdateStruct->offset = $collection->getOffset();
            $collectionUpdateStruct->limit = $collection->getLimit() ?? 0;
        }

        return $collectionUpdateStruct;
    }