Skip to content

PYTHON-5429 Server command is case sensitive #2421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ PyMongo 4.14 brings a number of changes including:
- Added :meth:`pymongo.asynchronous.mongo_client.AsyncMongoClient.append_metadata` and
:meth:`pymongo.mongo_client.MongoClient.append_metadata` to allow instantiated MongoClients to send client metadata
on-demand

- Introduces a minor breaking change. When encoding :class:`bson.binary.BinaryVector`, a ``ValueError`` will be raised
if the 'padding' metadata field is < 0 or > 7, or non-zero for any type other than PACKED_BIT.
- Fixed a bug that raised ``EncryptionError`` when using :meth:`pymongo.mongo_client.MongoClient.server_info` with an
encrypted connection.

Changes in Version 4.13.2 (2025/06/17)
--------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions pymongo/asynchronous/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,12 +834,12 @@ async def command(
Any additional keyword arguments will be added to the final
command document before it is sent.

For example, a command like ``{buildinfo: 1}`` can be sent
For example, a command like ``{buildInfo: 1}`` can be sent
using:

>>> await db.command("buildinfo")
>>> await db.command("buildInfo")
OR
>>> await db.command({"buildinfo": 1})
>>> await db.command({"buildInfo": 1})

For a command where the value matters, like ``{count:
collection_name}`` we can do:
Expand Down
2 changes: 1 addition & 1 deletion pymongo/asynchronous/mongo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2311,7 +2311,7 @@ async def server_info(
return cast(
dict,
await self.admin.command(
"buildinfo", read_preference=ReadPreference.PRIMARY, session=session
"buildInfo", read_preference=ReadPreference.PRIMARY, session=session
),
)

Expand Down
6 changes: 3 additions & 3 deletions pymongo/synchronous/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,12 +834,12 @@ def command(
Any additional keyword arguments will be added to the final
command document before it is sent.

For example, a command like ``{buildinfo: 1}`` can be sent
For example, a command like ``{buildInfo: 1}`` can be sent
using:

>>> db.command("buildinfo")
>>> db.command("buildInfo")
OR
>>> db.command({"buildinfo": 1})
>>> db.command({"buildInfo": 1})

For a command where the value matters, like ``{count:
collection_name}`` we can do:
Expand Down
2 changes: 1 addition & 1 deletion pymongo/synchronous/mongo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2303,7 +2303,7 @@ def server_info(self, session: Optional[client_session.ClientSession] = None) ->
return cast(
dict,
self.admin.command(
"buildinfo", read_preference=ReadPreference.PRIMARY, session=session
"buildInfo", read_preference=ReadPreference.PRIMARY, session=session
),
)

Expand Down
Loading