Skip to content

1.0.0

Choose a tag to compare

@MobyNL MobyNL released this 13 Aug 10:12
· 19 commits to main since this release

First release the version number claims is stable. It collects the work staged as 0.3.0, which was never published, and completes the keyword surface: 50 keywords covering the parts of pymongo a test suite actually reaches for.

pip install robotframework-mongodb

📖 Keyword documentation

Read this before upgrading

Several fixes change behaviour that previously failed silently, so suites that appeared to pass may start reporting real failures. That is the point of the release.

  • Switch Database had no effect. It set an attribute no other keyword read, so every later keyword kept using the previous connection — writing to the wrong database, or failing with KeyError: 'default'.
  • Delete Document and Delete Many coerced every query value to a string. Delete Many coll count=${5} searched for "5", deleted nothing and reported success.
  • A document could not be found by its _id in string form. Insert Document returns an ObjectId; once that value passed through a Robot variable, a CSV or a JSON fixture it became text and no longer matched. A string _id in a query is now converted automatically, including inside $in. This rewrites part of your query, so it is documented in full and can be turned off with coerce_object_ids=${False}.
  • The assertion keywords could loop forever. The retry deadline was advanced by adding retry_pause to a counter, so retry_pause=0 seconds never reached the timeout.
  • Connecting reported success against an unreachable server, because pymongo connects lazily. Both connect keywords now verify before passing.

Nothing that worked before is removed or renamed, and every new argument defaults to the previous behaviour, so upgrading from 0.2.2 needs no changes to a suite beyond those the fixes force.

New in this release

Collections and databases — Create Collection, Drop Collection, List Collections, List Databases, Drop Database, Get Server Info. Emptying a collection leaves its indexes and options behind, so a unique index created by one test still rejected the next one's fixtures; dropping it is what actually resets it.

Writing — Replace Document, and upsert on all four Update keywords. "Ensure this document exists with these values" previously had no expression, so fixture setup could not be written to run twice.

Reading — Get Distinct Values, Get Estimated Document Count, Delete Document And Return It, plus limit/skip on counting and allow_disk_use on aggregation.

Retrying assertions — Document Should Exist, Document Should Not Exist, Check Distinct Values, Check Collection Exists, Check Index Exists. They carry the retry loop, which is the part a suite gets wrong when it hand-rolls a wait.

Indexes — Get Index Information, Drop All Indexes, and sparse, expire_after_seconds and partial_filter_expression on Create Index.

Connections — replica_set, direct_connection, read_preference and auth_mechanism, previously reachable only by writing a connection string.

Run Database Command reaches everything left unwrapped: collStats, dbStats, explain, the administrative commands.

Transactions, change streams, GridFS and client-side encryption are deliberately absent — none of them fit a synchronous keyword taken one at a time.

Compatibility

Python 3.12–3.14, pymongo 4.x, Robot Framework 7. CI runs the acceptance suite against a MongoDB 8 replica set on every change, and the connection suite against MongoDB Atlas for mongodb+srv and TLS.

Full detail in the changelog.