Library: MongoDB
Package: MongoDB
Header: Poco/MongoDB/DeleteRequest.h
Class for creating an OP_DELETE client request. This request is used to delete one ore more documents from a database.
Specific flags for this request - DELETE_NONE
No flags
- DELETE_SINGLE_REMOVE
Delete only the first document
Direct Base Classes: RequestMessage
All Base Classes: Message, RequestMessage
Member Functions: buildRequest, flags, selector
Inherited Functions: buildRequest, header, messageLength, send
typedef enum { DELETE_NONE = 0, DELETE_SINGLE_REMOVE = 1 } Flags;
DeleteRequest(
const std::string & collectionName,
Flags flags = DELETE_NONE
);
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".
DeleteRequest(
const std::string & collectionName,
bool justOne
);
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". When justOne is true, only the first matching document will be removed (the same as using flag DELETE_SINGLE_REMOVE).
virtual ~DeleteRequest();
Destructor
Flags flags() const;
Returns flags
void flags(
Flags flag
);
Sets flags
Document & selector();
Returns the selector document
void buildRequest(
BinaryWriter & writer
);
Writes the OP_DELETE request to the writer