2013-02-02 21:52:49 +01:00
|
|
|
//
|
|
|
|
// DeleteRequest.cpp
|
|
|
|
//
|
|
|
|
// Library: MongoDB
|
|
|
|
// Package: MongoDB
|
|
|
|
// Module: DeleteRequest
|
|
|
|
//
|
|
|
|
// Copyright (c) 2012, Applied Informatics Software Engineering GmbH.
|
|
|
|
// and Contributors.
|
|
|
|
//
|
2014-05-04 21:02:42 +02:00
|
|
|
// SPDX-License-Identifier: BSL-1.0
|
2013-02-02 21:52:49 +01:00
|
|
|
//
|
|
|
|
|
2013-03-17 19:34:36 +01:00
|
|
|
|
2013-02-02 21:52:49 +01:00
|
|
|
#include "Poco/MongoDB/DeleteRequest.h"
|
|
|
|
|
2013-03-17 19:34:36 +01:00
|
|
|
|
|
|
|
namespace Poco {
|
|
|
|
namespace MongoDB {
|
2013-02-02 21:52:49 +01:00
|
|
|
|
|
|
|
|
2017-02-13 15:53:08 +01:00
|
|
|
DeleteRequest::DeleteRequest(const std::string& collectionName, DeleteRequest::Flags flags):
|
2022-07-07 11:18:20 +02:00
|
|
|
RequestMessage(MessageHeader::OP_DELETE),
|
|
|
|
_flags(flags),
|
2013-02-02 21:52:49 +01:00
|
|
|
_fullCollectionName(collectionName),
|
|
|
|
_selector()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-02-15 22:32:24 +01:00
|
|
|
|
2017-02-13 15:53:08 +01:00
|
|
|
DeleteRequest::DeleteRequest(const std::string& collectionName, bool justOne):
|
|
|
|
RequestMessage(MessageHeader::OP_DELETE),
|
|
|
|
_flags(justOne ? DELETE_SINGLE_REMOVE : DELETE_DEFAULT),
|
2013-02-15 22:32:24 +01:00
|
|
|
_fullCollectionName(collectionName),
|
|
|
|
_selector()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-02-02 21:52:49 +01:00
|
|
|
DeleteRequest::~DeleteRequest()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-03-17 19:34:36 +01:00
|
|
|
|
2013-02-02 21:52:49 +01:00
|
|
|
void DeleteRequest::buildRequest(BinaryWriter& writer)
|
|
|
|
{
|
|
|
|
writer << 0; // 0 - reserved for future use
|
2013-02-13 19:10:57 +01:00
|
|
|
BSONWriter(writer).writeCString(_fullCollectionName);
|
2013-02-02 21:52:49 +01:00
|
|
|
writer << _flags;
|
2013-02-13 19:10:57 +01:00
|
|
|
_selector.write(writer);
|
2013-02-02 21:52:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-03-17 19:34:36 +01:00
|
|
|
} } // namespace Poco::MongoDB
|