# Poco::MongoDB

# class UpdateRequest

Library: MongoDB
Package: MongoDB
Header: Poco/MongoDB/UpdateRequest.h

## Description

Class for creating an OP_UPDATE client request. This request is used to update a document.

## Inheritance

Direct Base Classes: RequestMessage

All Base Classes: Message, RequestMessage

## Member Summary

Member Functions: buildRequest, flags, selector, update

Inherited Functions: buildRequest, header, messageLength, send

## Types

### UPDATE_NOFLAGS

typedef enum { UPDATE_NOFLAGS = 0, UPDATE_UPSERT = 1, UPDATE_MULTIUPDATE = 2 } Flags;

## Constructors

### UpdateRequest

UpdateRequest(
const std::string & collectionName,
Flags flags = UPDATE_NOFLAGS
);

Constructor. The full collection name is the concatenation of the database name with the collection name, using a "." for the concatenation. For example, for the database "foo" and the collection "bar", the full collection name is "foo.bar".

## Destructor

### ~UpdateRequest

virtual ~UpdateRequest();

Destructor

## Member Functions

### flags

Flags flags() const;

Returns the flags

### flags

void flags(
Flags flags
);

Sets the flags

### selector

Document & selector();

Returns the selector document

### update

Document & update();

The document to update

### buildRequest

void buildRequest(
BinaryWriter & writer
);

See also: Poco::MongoDB::RequestMessage::buildRequest()