Poco::MongoDB

class DeleteRequest

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

Description

A DeleteRequest is used to delete one ore more documents from a database.

Specific flags for this request

Inheritance

Direct Base Classes: RequestMessage

All Base Classes: Message, RequestMessage

Member Summary

Member Functions: buildRequest, flags, selector

Inherited Functions: buildRequest, header, messageLength, send

Enumerations

Flags

DELETE_DEFAULT = 0

Default

DELETE_SINGLE_REMOVE = 1

Delete only the first document.

Constructors

DeleteRequest

DeleteRequest(
    const std::string & collectionName,
    Flags flags = DELETE_DEFAULT
);

Creates a DeleteRequest for the given collection using the given flags.

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".

DeleteRequest

DeleteRequest(
    const std::string & collectionName,
    bool justOne
);

Creates a DeleteRequest for the given collection.

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".

If justOne is true, only the first matching document will be removed (the same as using flag DELETE_SINGLE_REMOVE).

Destructor

~DeleteRequest virtual

virtual ~DeleteRequest();

Destructor

Member Functions

flags inline

Flags flags() const;

Returns the flags.

flags

void flags(
    Flags flag
);

Sets the flags.

selector inline

Document & selector();

Returns the selector document.

buildRequest protected virtual

void buildRequest(
    BinaryWriter & writer
);

Writes the OP_DELETE request to the writer.

Securely control IoT edge devices from anywhere   Connect a Device