From bcb75cf5f7431cc13c9c19f480e11424fe867a24 Mon Sep 17 00:00:00 2001 From: Zak <19314863+zakarybk@users.noreply.github.com> Date: Fri, 22 Mar 2024 14:28:57 +0000 Subject: [PATCH] PYTHON-4294 Add Note on Dict Ordering (#1558) --- doc/examples/aggregation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/examples/aggregation.rst b/doc/examples/aggregation.rst index 22e19e984..9b1a89fba 100644 --- a/doc/examples/aggregation.rst +++ b/doc/examples/aggregation.rst @@ -45,8 +45,8 @@ To achieve this we need to pass in three operations to the pipeline. First, we need to unwind the ``tags`` array, then group by the tags and sum them up, finally we sort by count. -As python dictionaries don't maintain order you should use :class:`~bson.son.SON` -or :class:`collections.OrderedDict` where explicit ordering is required +Python dictionaries prior to 3.7 don't maintain order. You should use :class:`~bson.son.SON` +or :class:`collections.OrderedDict` where explicit ordering is required for an older Python version eg "$sort": .. note::