Skip to content

Commit 697c3a5

Browse files
committed
PyMongo 3 compatibility.
"auto_start_request" option is gone, "max_pool_size" renamed to "maxPoolSize", "safe" is gone, "_connect" is renamed "connect". Closes issue django-nonrel#207.
1 parent 6781ea3 commit 697c3a5

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Changelog
66
Version 0.5.2 (TBD)
77
-----------------
88
* Add support for Replica Sets (Thanks @r4fek)
9+
* PyMongo 3 support
910

1011

1112
Version 0.5.1 (Nov 2013)

django_mongodb_engine/base.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,8 @@ def pop(name, default=None):
248248
conn_options = dict(
249249
host=host,
250250
port=int(port),
251-
max_pool_size=None,
252251
document_class=dict,
253252
tz_aware=False,
254-
_connect=True,
255-
auto_start_request=True,
256-
safe=False
257253
)
258254
conn_options.update(options)
259255

docs/source/reference/settings.rst

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ MongoDB Engine does is lower-casing the names before passing the flags to
2929

3030
.. _operations-setting:
3131

32-
Safe Operations (``getLastError``)
33-
----------------------------------
32+
Acknowledged Operations
33+
-----------------------
3434
Use the ``OPERATIONS`` dict to specify extra flags passed to
3535
:meth:`Collection.save <pymongo.collection.Collection.save>`,
3636
:meth:`~pymongo.collection.Collection.update` or
37-
:meth:`~pymongo.collection.Collection.remove` (and thus to ``getLastError``):
37+
:meth:`~pymongo.collection.Collection.remove` (and thus included in the
38+
write concern):
3839

3940
.. code-block:: python
4041
@@ -43,19 +44,13 @@ Use the ``OPERATIONS`` dict to specify extra flags passed to
4344
...
4445
}
4546
46-
Since any options to ``getLastError`` imply ``safe=True``,
47-
this configuration passes ``safe=True, w=3`` as keyword arguments to each of
48-
:meth:`~pymongo.collection.Collection.save`,
49-
:meth:`~pymongo.collection.Collection.update` and
50-
:meth:`~pymongo.collection.Collection.remove`.
51-
5247
Get a more fine-grained setup by introducing another layer to this dict:
5348

5449
.. code-block:: python
5550
5651
'OPTIONS' : {
5752
'OPERATIONS' : {
58-
'save' : {'safe' : True},
53+
'save' : {'w': 3},
5954
'update' : {},
6055
'delete' : {'fsync' : True}
6156
},

0 commit comments

Comments
 (0)