enh(MongoDB): MongoDB 6.0/7.0/8.0 compat -- partial indexes, Decimal128, SCRAM-SHA-256 - #5359
Merged
Merged
Conversation
matejk
force-pushed
the
mongodb-6-7-8-compat-doc-and-fixes
branch
from
May 19, 2026 13:02
c95ea9d to
d3f891a
Compare
Status tables for MongoDB 6.0/7.0/8.0 features (driver baseline, aggregation, indexes, BSON types) plus features obsolete in recent MongoDB that Poco still exposes. "Added 1.15.x" rows refer to the gap-closing commits that follow in this patch series.
New Database::createIndex overload taking a Document::Ptr extraOptions merged into the per-index spec, making partialFilterExpression (3.2+), collation (3.4+), wildcardProjection (4.2+ / 7.0 compound), text/2dsphere/geo options reachable from the typed helper. Add INDEX_HIDDEN (4.4+). Mark INDEX_BACKGROUND POCO_DEPRECATED (server no-op since 4.2); kept for source compat, no longer forwarded.
Document::read previously threw NotImplementedException on TypeIds 0x13, 0xFF, 0x7F. Decimal128 implements the IEEE 754-2008 BID format with canonical string conversion per Section 5.12.4; MinKey and MaxKey are zero-payload sentinels used in shard-key bounds and admin command output. No arithmetic on Decimal128 -- round-trip through std::string for ops.
SCRAM-SHA-256 (MongoDB 4.0+) is the server default for new users. Database::authenticate() default flipped from SHA-1 to SHA-256; pass AUTH_SCRAM_SHA1 explicitly for legacy deployments. Internal SCRAM math factored into a templated runScramAuth<HashEngine> shared by both mechanisms. SASLprep (RFC 4013) on the password: ASCII fast-path only, non-ASCII throws NotImplementedException pending full SASLprep.
- CMD_MAP_REDUCE: POCO_DEPRECATED (mapReduce deprecated by MongoDB in 5.0).
- Database::count() now uses aggregation [{$count:"n"}]: Stable API v1,
accurate on sharded clusters, allowed in transactions.
- Connection URI parser accepts "tls=" as an alias for "ssl=" (canonical
since 4.2).
Bugs: - README Quick Start example did not compile against the actual API. - Connection::connect(uri) URI default authMechanism still SHA-1, contradicting the doc-comment after the SHA-256 flip; aligned to SHA-256. - Decimal128::fromString silently accepted "1E"/"1E+" as the mantissa; now requires at least one exponent digit. - Decimal128::fromString stripped trailing zeros from the coefficient, breaking the canonical (coefficient, exponent) pair per the BSON spec. - Decimal128::toString large-coefficient path emitted "0E-1" instead of "0.0" for negative exponents; falls through to the standard renderer. - Database::INDEX_SPARSE doc-comment attached to the wrong enumerator. - testConnectionURITlsAlias third case had an inaccurate comment. - CodeQL: removed for-loop counter mutation in Decimal128::fromString. Cleanup: dead constants renamed in Decimal128.cpp; toString digit emission consolidated; isAsciiOnly uses std::all_of; named constexpr bools at runScramAuth call sites; tls test replaced with a 3-line lambda; restates-WHAT comments trimmed; README version phrasing normalized to "(since X.Y)". Tests extended with trailing-zero preservation, SyntaxException and RangeException paths in Decimal128.
matejk
force-pushed
the
mongodb-6-7-8-compat-doc-and-fixes
branch
from
May 19, 2026 13:07
d3f891a to
c188bf3
Compare
Windows can reject an oversized SharedMemory allocation with either ERROR_NOT_ENOUGH_MEMORY (8) or ERROR_NO_SYSTEM_RESOURCES (1450) depending on which allocator tier runs out first; the test only accepted the former, intermittently failing on windows-2025 CI runners.
matejk
added a commit
that referenced
this pull request
May 20, 2026
…28, SCRAM-SHA-256 (#5359) * docs(MongoDB): add server-feature compatibility README Status tables for MongoDB 6.0/7.0/8.0 features (driver baseline, aggregation, indexes, BSON types) plus features obsolete in recent MongoDB that Poco still exposes. "Added 1.15.x" rows refer to the gap-closing commits that follow in this patch series. * feat(MongoDB): partial / hidden / collation / wildcard index options New Database::createIndex overload taking a Document::Ptr extraOptions merged into the per-index spec, making partialFilterExpression (3.2+), collation (3.4+), wildcardProjection (4.2+ / 7.0 compound), text/2dsphere/geo options reachable from the typed helper. Add INDEX_HIDDEN (4.4+). Mark INDEX_BACKGROUND POCO_DEPRECATED (server no-op since 4.2); kept for source compat, no longer forwarded. * feat(MongoDB): add Decimal128, MinKey, MaxKey BSON types Document::read previously threw NotImplementedException on TypeIds 0x13, 0xFF, 0x7F. Decimal128 implements the IEEE 754-2008 BID format with canonical string conversion per Section 5.12.4; MinKey and MaxKey are zero-payload sentinels used in shard-key bounds and admin command output. No arithmetic on Decimal128 -- round-trip through std::string for ops. * feat(MongoDB): add SCRAM-SHA-256 authentication SCRAM-SHA-256 (MongoDB 4.0+) is the server default for new users. Database::authenticate() default flipped from SHA-1 to SHA-256; pass AUTH_SCRAM_SHA1 explicitly for legacy deployments. Internal SCRAM math factored into a templated runScramAuth<HashEngine> shared by both mechanisms. SASLprep (RFC 4013) on the password: ASCII fast-path only, non-ASCII throws NotImplementedException pending full SASLprep. * chore(MongoDB): mark deprecated features, rewrite count(), tls URI alias - CMD_MAP_REDUCE: POCO_DEPRECATED (mapReduce deprecated by MongoDB in 5.0). - Database::count() now uses aggregation [{$count:"n"}]: Stable API v1, accurate on sharded clusters, allowed in transactions. - Connection URI parser accepts "tls=" as an alias for "ssl=" (canonical since 4.2). * fix(MongoDB): apply review feedback Bugs: - README Quick Start example did not compile against the actual API. - Connection::connect(uri) URI default authMechanism still SHA-1, contradicting the doc-comment after the SHA-256 flip; aligned to SHA-256. - Decimal128::fromString silently accepted "1E"/"1E+" as the mantissa; now requires at least one exponent digit. - Decimal128::fromString stripped trailing zeros from the coefficient, breaking the canonical (coefficient, exponent) pair per the BSON spec. - Decimal128::toString large-coefficient path emitted "0E-1" instead of "0.0" for negative exponents; falls through to the standard renderer. - Database::INDEX_SPARSE doc-comment attached to the wrong enumerator. - testConnectionURITlsAlias third case had an inaccurate comment. - CodeQL: removed for-loop counter mutation in Decimal128::fromString. Cleanup: dead constants renamed in Decimal128.cpp; toString digit emission consolidated; isAsciiOnly uses std::all_of; named constexpr bools at runScramAuth call sites; tls test replaced with a 3-line lambda; restates-WHAT comments trimmed; README version phrasing normalized to "(since X.Y)". Tests extended with trailing-zero preservation, SyntaxException and RangeException paths in Decimal128. * test(Foundation): accept ERROR_NO_SYSTEM_RESOURCES in SharedMemoryTest Windows can reject an oversized SharedMemory allocation with either ERROR_NOT_ENOUGH_MEMORY (8) or ERROR_NO_SYSTEM_RESOURCES (1450) depending on which allocator tier runs out first; the test only accepted the former, intermittently failing on windows-2025 CI runners.
matejk
added a commit
that referenced
this pull request
May 20, 2026
Four PRs merged on main after the release commit and cherry-picked into poco-1.15.3: - #5358 fix(AbstractEvent): operator-= holds the event mutex across Delegate destructor - #5359 enh(MongoDB): MongoDB 6.0/7.0/8.0 compat (carries its own API Changes block for SCRAM-SHA-256 default, count() via $count, deprecated INDEX_BACKGROUND / CMD_MAP_REDUCE) - #5355 (GH #5354) feat(CppUnit): terminate handler - #5356 fix(Foundation): gate atomic_flag::test on C++20 atomic_wait Also tighten the Summary paragraph to call out the MongoDB compat work and add the MongoDB API Changes to doc/99100-ReleaseNotes.page to match CHANGELOG. CONTRIBUTORS unchanged -- all four PR authors (aleks-f, uilianries, matejk) are already listed.
matejk
added a commit
that referenced
this pull request
May 20, 2026
…5.3 overview Four PRs merged on main after the release commit and cherry-picked into poco-1.15.3: - #5358 fix(AbstractEvent): operator-= holds the event mutex across Delegate destructor - #5359 enh(MongoDB): MongoDB 6.0/7.0/8.0 compat (carries its own API Changes for SCRAM-SHA-256 default, count() via $count, deprecated INDEX_BACKGROUND / CMD_MAP_REDUCE) - #5355 (GH #5354) feat(CppUnit): terminate handler - #5356 fix(Foundation): gate atomic_flag::test on C++20 atomic_wait Also tighten the 1.15.3 entries: trim the Summary paragraph, replace multi-paragraph API Changes prose with one-line bullets, drop redundant qualifiers from bug-fix / enhancement bullets, and use the verbatim GitHub issue/PR titles for each item. CHANGELOG and doc/99100-ReleaseNotes.page now carry the same content. CONTRIBUTORS unchanged -- all four PR authors (aleks-f, uilianries, matejk) are already listed.
matejk
added a commit
that referenced
this pull request
May 20, 2026
…5.3 overview Four PRs merged on main after the release commit and cherry-picked into poco-1.15.3: - #5358 fix(AbstractEvent): operator-= holds the event mutex across Delegate destructor - #5359 enh(MongoDB): MongoDB 6.0/7.0/8.0 compat (carries its own API Changes for SCRAM-SHA-256 default, count() via $count, deprecated INDEX_BACKGROUND / CMD_MAP_REDUCE) - #5355 (GH #5354) feat(CppUnit): terminate handler - #5356 fix(Foundation): gate atomic_flag::test on C++20 atomic_wait Also tighten the 1.15.3 entries: trim the Summary paragraph, replace multi-paragraph API Changes prose with one-line bullets, drop redundant qualifiers from bug-fix / enhancement bullets, and use the verbatim GitHub issue/PR titles for each item. CHANGELOG and doc/99100-ReleaseNotes.page now carry the same content. CONTRIBUTORS unchanged -- all four PR authors (aleks-f, uilianries, matejk) are already listed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Audit of Poco::MongoDB versus MongoDB server 6.0 / 7.0 / 8.0, plus a set
of contained gap closures for the 1.15.3 release. The branch ships six
commits: five feature/docs commits and one consolidated review-feedback
fix commit produced by a four-agent code review (general / simplification
Server-feature compatibility doc
MongoDB/README.mdwith status tables for MongoDB 6.0 / 7.0 / 8.0server features (driver baseline, aggregation, indexes, BSON types),
plus a section listing features obsolete in recent MongoDB that are
still exposed by Poco (e.g.
CMD_MAP_REDUCE,CMD_COUNT,INDEX_BACKGROUND).New API surface
Database::createIndex(connection, coll, fields, name, extraOptions, ...)overload: every element of
extraOptionsis merged into the per-indexspec, making
partialFilterExpression(3.2+),collation(3.4+),wildcardProjection(4.2+ / 7.0 compound wildcard), text / 2dsphere /geo options reachable from the typed helper.
Database::INDEX_HIDDENflag (MongoDB 4.4+).Decimal128(TypeId 0x13, MongoDB 3.4+) withcanonical IEEE 754-2008 string conversion,
MinKey(TypeId 0xFF),MaxKey(TypeId 0x7F).Document::readno longer throwsNotImplementedExceptionon these types.AUTH_SCRAM_SHA256constant;Database::authenticate()defaultflipped from SCRAM-SHA-1 to SCRAM-SHA-256, matching the MongoDB
server default for users created since 4.0 and the convention used
by every official MongoDB driver. ASCII passwords only on the
SCRAM-SHA-256 path; non-ASCII throws
NotImplementedExceptionpending full SASLprep (RFC 4013).
Connection::connect(uri, ...)acceptstls=trueas an alias forthe historical
ssl=trueURI option. URI defaultauthMechanismalso flipped to SCRAM-SHA-256 to match
Database::authenticate().Deprecations / modernization
OpMsgMessage::CMD_MAP_REDUCEmarkedPOCO_DEPRECATED(mapReducedeprecated by MongoDB in 5.0). Use the aggregation pipeline.
Database::INDEX_BACKGROUNDmarkedPOCO_DEPRECATED(4.2 serverno-op). Kept for source compatibility; no longer forwarded.
Database::count()rewritten internally to use aggregation[{$count: "n"}]rather than the legacycountcommand. Samesignature. Aggregation
$countis in the Stable API v1, accurate onsharded clusters, and permitted in multi-document transactions.
Tests
98 offline tests pass (8 new BSONTest cases for createIndex element
merging, Decimal128 specials / parsing / round-trip / serialization with
trailing-zero preservation per the BSON spec, plus SyntaxException /
RangeException paths, MinKey/MaxKey serialization, auth constants, the
SASLprep ASCII guard, and the
tls=URI alias).Notes
User-visible changes that warrant entries: the two default-auth
flips (
Database::authenticate()andConnection::connect(uri)URI),
Database::count()internal rewrite,INDEX_BACKGROUND/CMD_MAP_REDUCEPOCO_DEPRECATEDmarkings, plus the new featurebullets (
createIndexextraOptions overload,INDEX_HIDDEN,Decimal128 / MinKey / MaxKey,
tls=URI alias).Test plan
cmake -B build -DENABLE_TESTS=ON -DPOCO_MINIMAL_BUILD=ON -DENABLE_MONGODB=ON -DENABLE_FOUNDATION=ON -DENABLE_NET=ON -DENABLE_CRYPTO=ON -DENABLE_JSON=ON -DENABLE_UTIL=ONcmake --build build --target MongoDB-testrunnerPOCO_BASE=$PWD PATH="$PATH:$PWD/build/bin" ./build/bin/MongoDB-testrunner -all-- expect 98 OK.