You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/changelog.rst
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,21 @@ Changelog
7
7
Development
8
8
===========
9
9
- (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
10
16
- 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)
Copy file name to clipboardExpand all lines: docs/guide/defining-documents.rst
+24-4Lines changed: 24 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ documents are serialized based on their field order.
29
29
30
30
.. _dynamic-document-schemas:
31
31
32
-
Dynamic document schemas
32
+
Dynamic Document Schemas
33
33
========================
34
34
One of the benefits of MongoDB is dynamic schemas for a collection, whilst data
35
35
should be planned and organised (after all explicit is better than implicit!)
@@ -260,7 +260,7 @@ document class as the first argument::
260
260
comment2 = Comment(content='Nice article!')
261
261
page = Page(comments=[comment1, comment2])
262
262
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`
264
264
by inheriting :class:`~mongoengine.DynamicEmbeddedDocument`.
265
265
266
266
Dictionary Fields
@@ -325,7 +325,7 @@ as the constructor's argument::
325
325
.. _many-to-many-with-listfields:
326
326
327
327
Many to Many with ListFields
328
-
'''''''''''''''''''''''''''
328
+
''''''''''''''''''''''''''''
329
329
330
330
If you are implementing a many to many relationship via a list of references,
331
331
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
491
491
ip_address = StringField()
492
492
meta = {'max_documents': 1000, 'max_size': 2000000}
493
493
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
+
494
514
.. defining-indexes_
495
515
496
516
Indexes
@@ -579,7 +599,7 @@ There are a few top level defaults for all indexes that can be set::
579
599
580
600
581
601
: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/>`_
583
603
584
604
:attr:`index_background` (Optional)
585
605
Set the default value for if an index should be indexed in the background
0 commit comments