Skip to content

Commit c33cd1d

Browse files
authored
Merge branch 'master' into transactions-global-session-ver
2 parents c4c4245 + ccae19c commit c33cd1d

36 files changed

+591
-233
lines changed

.github/workflows/github-actions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
- name: Set up Python ${{ matrix.python-version }}
124124
uses: actions/setup-python@v4
125125
with:
126-
python-version: 3.7
126+
python-version: 3.9
127127
check-latest: true
128128
- name: install python dep
129129
run: |

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM mongo:5
2+
3+
COPY ./entrypoint.sh entrypoint.sh
4+
RUN chmod u+x entrypoint.sh
5+
ENTRYPOINT ./entrypoint.sh

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ You may also have `setuptools <http://peak.telecommunity.com/DevCenter/setuptool
4848
and thus you can use ``easy_install -U mongoengine``. Another option is
4949
`pipenv <https://docs.pipenv.org/>`_. You can then use ``pipenv install mongoengine``
5050
to both create the virtual environment and install the package. Otherwise, you can
51-
download the source from `GitHub <http://github.com/MongoEngine/mongoengine>`_ and
51+
download the source from `GitHub <https://github.com/MongoEngine/mongoengine>`_ and
5252
run ``python setup.py install``.
5353

5454
The support for Python2 was dropped with MongoEngine 0.20.0
@@ -66,7 +66,7 @@ If you utilize a ``DateTimeField``, you might also use a more flexible date pars
6666

6767
If you need to use an ``ImageField`` or ``ImageGridFsProxy``:
6868

69-
- Pillow>=2.0.0
69+
- Pillow>=7.0.0
7070

7171
If you need to use signals:
7272

docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
mongoengine:
3+
build:
4+
context: .
5+
image: mongoengine:latest
6+
ports:
7+
- 27017:27017

docs/Makefile

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,10 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
1616

1717
help:
1818
@echo "Please use \`make <target>' where <target> is one of"
19+
@echo " html-readthedocs to simulate an html-build for readthedocs"
1920
@echo " html to make standalone HTML files"
2021
@echo " dirhtml to make HTML files named index.html in directories"
21-
@echo " pickle to make pickle files"
22-
@echo " json to make JSON files"
2322
@echo " htmlhelp to make HTML files and a HTML help project"
24-
@echo " qthelp to make HTML files and a qthelp project"
25-
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
2623
@echo " changes to make an overview of all changed/added/deprecated items"
2724
@echo " linkcheck to check all external links for integrity"
2825
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@@ -40,47 +37,20 @@ html:
4037

4138
html-readthedocs:
4239
$(SPHINXBUILD) -T -E -b readthedocs $(ALLSPHINXOPTS) $(BUILDDIR)/html
43-
@echo
4440
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
45-
41+
@echo "Open in browser: file://`realpath $(BUILDDIR)/html/index.html`"
4642

4743
dirhtml:
4844
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
4945
@echo
5046
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
5147

52-
pickle:
53-
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
54-
@echo
55-
@echo "Build finished; now you can process the pickle files."
56-
57-
json:
58-
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
59-
@echo
60-
@echo "Build finished; now you can process the JSON files."
61-
6248
htmlhelp:
6349
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
6450
@echo
6551
@echo "Build finished; now you can run HTML Help Workshop with the" \
6652
".hhp project file in $(BUILDDIR)/htmlhelp."
6753

68-
qthelp:
69-
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
70-
@echo
71-
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
72-
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
73-
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/MongoEngine.qhcp"
74-
@echo "To view the help file:"
75-
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/MongoEngine.qhc"
76-
77-
latex:
78-
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
79-
@echo
80-
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
81-
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
82-
"run these through (pdf)latex."
83-
8454
changes:
8555
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
8656
@echo

docs/changelog.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,21 @@ Changelog
77
Development
88
===========
99
- (Fill this out as you fix issues and develop your features).
10+
11+
Changes in 0.29.0
12+
=================
13+
- Fix weakref in EmbeddedDocumentListField (causing brief mem leak in certain circumstances) #2827
14+
- Fix pillow deprecation warning related with LANCZOS filter #2824
15+
- Allow gt/gte/lt/lte/ne operators to be used with a list as value on ListField #2813
1016
- Switch tox to use pytest instead of legacy `python setup.py test` #2804
17+
- Add support for timeseries collection #2661
18+
- Add support in tests for MongoDB 7.0, pymongo 4.7 and pymongo 4.8 in the CI #2826
19+
- Add support for `array_filters` in Queryset.modify #2811
20+
- Integrate a docker-compose setup for local testing #2555
21+
- improve ReferenceField wrong usage detection
22+
- Fix no_dereference thread-safetyness #2830
23+
- BREAKING CHANGE: max_length in ListField is now keyword only on ListField signature
24+
- BREAKING CHANGE: Force `field` argument of ListField/DictField to be a field instance (e.g ListField(StringField()) instead of ListField(StringField)
1125

1226
Changes in 0.28.2
1327
=================

docs/django.rst

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,4 @@ Django Support
33
==============
44

55
.. note:: Django support has been split from the main MongoEngine
6-
repository. The *legacy* Django extension may be found bundled with the
7-
0.9 release of MongoEngine.
8-
9-
10-
11-
Help Wanted!
12-
------------
13-
14-
The MongoEngine team is looking for help contributing and maintaining a new
15-
Django extension for MongoEngine! If you have Django experience and would like
16-
to help contribute to the project, please get in touch on the
17-
`mailing list <http://groups.google.com/group/mongoengine-users>`_ or by
18-
simply contributing on
19-
`GitHub <https://github.com/MongoEngine/django-mongoengine>`_.
6+
repository.

docs/faq.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ Does MongoEngine support asynchronous drivers (Motor, TxMongo)?
88
No, MongoEngine is exclusively based on PyMongo and isn't designed to support other driver.
99
If this is a requirement for your project, check the alternative: `uMongo`_ and `MotorEngine`_.
1010

11-
.. _uMongo: https://umongo.readthedocs.io/
12-
.. _MotorEngine: https://motorengine.readthedocs.io/
11+
.. _uMongo: https://umongo.readthedocs.io/en/latest/
12+
.. _MotorEngine: https://motorengine.readthedocs.io/en/latest/

docs/guide/connecting.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ of the MongoDB connection string is for::
4747
connect(host="mongodb://my_user:[email protected]:27017/my_db?authSource=my_db")
4848

4949
The URI string can also be used to configure advanced parameters like ssl, replicaSet, etc. For more
50-
information or example about URI string, you can refer to the `official doc <https://docs.mongodb.com/manual/reference/connection-string/>`_::
50+
information or example about URI string, you can refer to the `official doc <https://www.mongodb.com/docs/manual/reference/connection-string/>`_::
5151

5252
connect(host="mongodb://my_user:[email protected]:27017/my_db?authSource=admin&ssl=true&replicaSet=globaldb")
5353

docs/guide/defining-documents.rst

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ documents are serialized based on their field order.
2929

3030
.. _dynamic-document-schemas:
3131

32-
Dynamic document schemas
32+
Dynamic Document Schemas
3333
========================
3434
One of the benefits of MongoDB is dynamic schemas for a collection, whilst data
3535
should be planned and organised (after all explicit is better than implicit!)
@@ -260,7 +260,7 @@ document class as the first argument::
260260
comment2 = Comment(content='Nice article!')
261261
page = Page(comments=[comment1, comment2])
262262

263-
Embedded documents can also leverage the flexibility of :ref:`dynamic-document-schemas:`
263+
Embedded documents can also leverage the flexibility of :ref:`dynamic-document-schemas`
264264
by inheriting :class:`~mongoengine.DynamicEmbeddedDocument`.
265265

266266
Dictionary Fields
@@ -325,7 +325,7 @@ as the constructor's argument::
325325
.. _many-to-many-with-listfields:
326326

327327
Many to Many with ListFields
328-
'''''''''''''''''''''''''''
328+
''''''''''''''''''''''''''''
329329

330330
If you are implementing a many to many relationship via a list of references,
331331
then the references are stored as DBRefs and to query you need to pass an
@@ -491,6 +491,26 @@ The following example shows a :class:`Log` document that will be limited to
491491
ip_address = StringField()
492492
meta = {'max_documents': 1000, 'max_size': 2000000}
493493

494+
Timeseries collections
495+
----------------------
496+
A :class:`~mongoengine.Document` may use a **Timeseries Collection** by specifying
497+
:attr:`timeseries` in the :attr:`meta` dictionary. Timeseries collection were added
498+
in MongoDB 5.0 (`doc <https://www.mongodb.com/docs/v5.3/core/timeseries-collections/>`_).
499+
The following example shows a Document class with a basic setup::
500+
501+
class SensorData(Document):
502+
timestamp = DateTimeField(required=True)
503+
temperature = FloatField()
504+
505+
meta = {
506+
"timeseries": {
507+
"timeField": "timestamp",
508+
"metaField": "temperature",
509+
"granularity": "seconds",
510+
"expireAfterSeconds": 5,
511+
},
512+
}
513+
494514
.. defining-indexes_
495515
496516
Indexes
@@ -579,7 +599,7 @@ There are a few top level defaults for all indexes that can be set::
579599

580600

581601
:attr:`index_opts` (Optional)
582-
Set any default index options - see the `full options list <https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/#db.collection.createIndex>`_
602+
Set any default index options - see the `full options list <https://www.mongodb.com/docs/manual/reference/method/db.collection.createIndex/>`_
583603

584604
:attr:`index_background` (Optional)
585605
Set the default value for if an index should be indexed in the background

0 commit comments

Comments
 (0)