Files
poco/modules/Poco/MongoDB.cppm
Matej Kenda 51f3749fa0 MongoDB replica set support (#5068)
* feature(MongoDB): Initial implementation of support for replica sets.

* enh(MongoDB): Add parsing of mongodb replica set URI.

* enh(MongoDB): Treat single-server as primary, fix parsing of URI.

* fix(MongoDB): Add missing example for parsing the URI.

* enh(MongoDB): simplified and modernised code.

* fix(MongoDB): Fixes based on static analysis report.

* enh(MongoDB): Remove unused includes.

* fix(MongoDB): ReplicaSetMonitor: handle wrong arguments more gracefully.

* enh(MongoDB) Use string literals and char constants where possible.

* enh(MongoDB) More tests.

* fix(MongoDB): Prevent duplicate entries in MongoDB::Document.

* enh(MongoDB): Update RS tests, remove support for pre 5.1 MongoDB.

* enh(MongoDB): Use C++ std mutex primitives instead of Poco.

* fix(MongoDB): correct replica set compile errors.

* fix(MongoDB): fix replica set tests to work with IPv6 addresses.

* enh(MongoDB): Remove confusing hosts from ServerDescription and use hosts from "hello" only to discover replica set hosts.

* enh(MongoDB): fix unused variables in tests.

* enh(MongoDB): Add read-preference validation to replica set connection and pool.

* chore(MongoDB): Add reserve to Document.

* enh(MongoDB): connect to server in pool activateObject.

* chore(MongoDB): use tried servers set only locally inside executeWithRetry.

* enh(MongoDB): Add support for ReplicaSetConnection to OpMsgCursor.

* enh(MongoDB): Replica set: More robust retry of failed MongoDB commands.

* enh(MongoDB): ReplicaSet remove redundant function, update documentation.

* enh(MongoDB): Update handling of URL parameters.

* enh(MongoDB): Updates to use SSL socket factory.

* enh(MongoDB): Log topology change when detected.

* enh(MongoDB): Move function to wait for the server availability to ReplicaSet.

* enh(MongoDB): Replica set: send notification on topology change.

* enh(MongoDB): Replica set: Remove internal logger for

* enh(MongoDB): Replica set: Remove internal logger for topology change. Use notification instead.

* enh(MongoDB): Update samples and replica set readme.

* enh(MongoDB): Fix parsing replica set URI.

* enh(MongoDB): Introduce ReplicaSetURI for handling custom URI.

* fix(MongoDB): heartbeatFrequency --> heartbeatFrequencyMS to match standard URL

* enh(MongoDB): Introduce constants in ReplicaSetURI.

* chore(MongoDB): Minor enhancements.

* enh(MongoDB): Correct logic to determine replica set topology from discovered servers.

* enh(MongoDB): Remove redundant code when parsing hello response.

* enh(MongoDB): Prevent servers from different replica set to be used in the topology.

* enh(MongoDB): Mark topology with incompatible servers as Unknown.

* enh(CI): Speed-up build by using cmake --build --parallel 4

* enh(CI): Upgrade codeql from v3 to v4

https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/

* enh(modules): Update MongoDB module to reflect latest state.

enh(MongoDB): Remove dead code and mark Message as implementation detail.

enh(CI): Fix build of C++ modules

* fix(C++ modules): Use C++20 features in samples, not C++23.

* docs(MongoDB): Clarify RTT limitation in Nearest read preference
2025-12-16 07:49:36 +01:00

77 lines
2.2 KiB
C++

//
// MongoDB.cppm
//
// C++ module file
//
// Copyright (c) 2025, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
module;
#ifdef ENABLE_MONGODB
#include "Poco/MongoDB/Array.h"
#include "Poco/MongoDB/Binary.h"
#include "Poco/MongoDB/BSONReader.h"
#include "Poco/MongoDB/BSONWriter.h"
#include "Poco/MongoDB/Connection.h"
#include "Poco/MongoDB/Database.h"
#include "Poco/MongoDB/Document.h"
#include "Poco/MongoDB/Element.h"
#include "Poco/MongoDB/JavaScriptCode.h"
#include "Poco/MongoDB/Message.h"
#include "Poco/MongoDB/MessageHeader.h"
#include "Poco/MongoDB/MongoDB.h"
#include "Poco/MongoDB/ObjectId.h"
#include "Poco/MongoDB/OpMsgCursor.h"
#include "Poco/MongoDB/OpMsgMessage.h"
#include "Poco/MongoDB/PoolableConnectionFactory.h"
#include "Poco/MongoDB/ReadPreference.h"
#include "Poco/MongoDB/RegularExpression.h"
#include "Poco/MongoDB/ReplicaSet.h"
#include "Poco/MongoDB/ReplicaSetConnection.h"
#include "Poco/MongoDB/ReplicaSetPoolableConnectionFactory.h"
#include "Poco/MongoDB/ReplicaSetURI.h"
#include "Poco/MongoDB/ServerDescription.h"
#include "Poco/MongoDB/TopologyChangeNotification.h"
#include "Poco/MongoDB/TopologyDescription.h"
#endif
export module Poco.MongoDB;
export namespace Poco::MongoDB {
#ifdef ENABLE_MONGODB
// Main classes
using Poco::MongoDB::Array;
using Poco::MongoDB::BSONReader;
using Poco::MongoDB::BSONWriter;
using Poco::MongoDB::Binary;
using Poco::MongoDB::Connection;
using Poco::MongoDB::Database;
using Poco::MongoDB::Document;
using Poco::MongoDB::JavaScriptCode;
using Poco::MongoDB::ObjectId;
using Poco::MongoDB::OpMsgCursor;
using Poco::MongoDB::OpMsgMessage;
using Poco::MongoDB::ReadPreference;
using Poco::MongoDB::RegularExpression;
using Poco::MongoDB::ReplicaSet;
using Poco::MongoDB::ReplicaSetConnection;
using Poco::MongoDB::ReplicaSetURI;
using Poco::MongoDB::ServerDescription;
using Poco::MongoDB::TopologyChangeNotification;
using Poco::MongoDB::TopologyDescription;
// Helper classes and structs
using Poco::MongoDB::BSONTimestamp;
using Poco::MongoDB::PooledConnection;
using Poco::MongoDB::PooledReplicaSetConnection;
// Type aliases
using Poco::MongoDB::NullValue;
#endif
}