Poco::MongoDB

class UpdateRequest

File Information

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

Description

This request is used to update a document in a database using the OP_UPDATE client request.

Inheritance

Direct Base Classes: RequestMessage

All Base Classes: Message, RequestMessage

Member Summary

Member Functions: buildRequest, flags, selector, update

Inherited Functions: buildRequest, header, messageLength, send

Enumerations

Flags

UPDATE_DEFAULT = 0

If set, the database will insert the supplied object into the collection if no matching document is found.

UPDATE_UPSERT = 1

If set, the database will update all matching objects in the collection. Otherwise only updates first matching doc.

UPDATE_MULTIUPDATE = 2

If set to, updates multiple documents that meet the query criteria. Otherwise only updates one document.

Constructors

UpdateRequest

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

Creates the UpdateRequest.

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

virtual ~UpdateRequest();

Destroys the UpdateRequest.

Member Functions

flags inline

Flags flags() const;

Returns the flags

flags

void flags(
    Flags flags
);

Sets the flags

selector inline

Document & selector();

Returns the selector document.

update inline

Document & update();

Returns the document to update.

buildRequest protected virtual

void buildRequest(
    BinaryWriter & writer
);