Skip to content

Commit 4b65c90

Browse files
authored
128-reviva (#130)
* update docs * Move to uv * Syncing readme and index * Synced docs * Updated mongodb-umbrella page * Improved the why-use-monggregate page * Update doc * Improved how to guides * Docs improvements * Improved look and feel * Promote one level up the common pipelines use cases * Added context about dollar sign * Updated changelog * WIP improving code snippets look and feel * Improved look and feel of code snippets * Refactoring tests * Move old test to test_legacy - About to write new tests - Respecting the structure of the package * Covering each module with a dedicated test file * Add test on base * Test dollar * Add tests on fields * Add test on pipeline * test utils * Add tests bucket auto * Tests bucket * test for count, group and limit * Renamed stages in tests as tests_stages * test -> tests for tests folders * Tests lookup * Tests on match and lookup * Tests out and replace_root * Tests fir sample, set, skip, sort_by_count, sort, stage, union_with, unset and unwind * test vector search * Fixed tests
1 parent 3bb0933 commit 4b65c90

File tree

82 files changed

+4546
-1144
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+4546
-1144
lines changed

.gitignore

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
venv
2-
.venv
3-
.coverage
4-
.env
5-
notes.md
6-
**/*~
7-
**/notebook.ipynb
8-
**/report.html
9-
.mypy_cache
10-
.vscode
11-
**/__pycache__/
12-
tracker.xlsx
13-
~$tracker.xlsx
14-
monggregate.egg-info
15-
UNKNOWN.egg-info
16-
dist
17-
test.py
18-
site/
19-
.pypirc
1+
venv
2+
.venv
3+
.coverage
4+
.env
5+
notes.md
6+
**/*~
7+
**/notebook.ipynb
8+
**/report.html
9+
.mypy_cache
10+
.vscode
11+
**/__pycache__/
12+
tracker.xlsx
13+
~$tracker.xlsx
14+
monggregate.egg-info
15+
UNKNOWN.egg-info
16+
dist
17+
test.py
18+
site/
19+
.pypirc
20+
clean_pycache.ps1

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10

docs/changelog.md

Lines changed: 212 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,212 @@
1-
# Release Notes
2-
3-
## 0.18.0
4-
5-
### Fixes
6-
7-
* Fixed bug preventing to use `Compound` operator with `Search` and `SearchMeta` classes.
8-
9-
### New Features
10-
11-
* Pipelinized `Search` and `SearchMeta` classes. That is complex expressions can be built step by step by chaining operators.
12-
* Updated `search` method in `¨Pipeline` class to ease the use of the search stages.
13-
* Clarified and simplified faceted search
14-
15-
### Refactoring
16-
17-
* Use operators rather than statement in `Compound` class
18-
* Factorized `Search` and `SearchMeta` classes by creating a `SearchBase` class
19-
* Use `CountOptions` rather than raw dicts
20-
* Created `AnyStage` union type
21-
22-
### Docs
23-
24-
* Spelling and grammar fixes
25-
26-
## 0.17.0
27-
28-
### Docs
29-
30-
* First version of the documentation :champagne: !
31-
32-
## 0.16.2
33-
34-
### Fixes
35-
36-
* Allow to use iterable and dicts to group by in Group class and pipeline group function
37-
38-
## 0.16.1
39-
40-
### Fixes
41-
42-
* Fixed replace_root by passing document argument to ReplaceRoot class
43-
44-
45-
## 0.16.0
46-
47-
### New Features
48-
49-
* Created S object (represents $ sign since it is not a valid variable name in python) to store all MongoDB operators and to create references to fields
50-
* Created SS object (represents $$) to store aggregation variables and referenes to user variables
51-
* Interfaced a chunk of new operators(add, divide, multiply, pow, substract, cond, if_null, switch, millisecond, date_from_string, date_to_string, type_)
52-
* Integrated new operators in Expressions class
53-
54-
55-
### Refactoring
56-
57-
* Redefined Expressions completely. Simplified and clarified how they can be used when using this package.
58-
* Removed index module that was at the root of the package (monggregate.index.py -> ø)
59-
* Removed expressions subpackage (monggregate.expression -> ø)
60-
* Moved expressions fields module to the root of the package (monggregate.expressions.fields.py -> monggregate.fields.py)
61-
* Removed expressions aggregation_variables module (monggregate.expression.aggregation_variables.py -> ø)
62-
* Moved the enums that were defined in index to a more relevant place. Ex OperatorEnum is now in monggregate.operators.py
63-
64-
### Breaking Changes
65-
66-
* Operators now return python objects rather than expressions/statements.
67-
NOTE: The wording might change for clarification purposes.
68-
statement might be renamed expression and resolve might renamed express
69-
To do so, some arguments might need to be renamed in the operators
70-
* Expressions subpackage has been exploded and some parts have been deleted
71-
72-
### Documentation
73-
74-
* Updated readme to reflect changes in the packge. Readme now focuses on the recommended way to use the package and clarifies how to use MongoDB operators.
75-
76-
## 0.15.0
77-
78-
### Fixes
79-
80-
* Fixed bug in `Search.from_operator()` classmethod due to recent change in operator type in `Search` class
81-
* Fixed misspelled operators in constructors map in `Search` class
82-
* Fixed missing aliases and missing kwargs reduction in some `Search` operators
83-
84-
85-
## 0.14.1
86-
87-
### Fixes
88-
89-
* Fixed autocompletion
90-
91-
### Refactoring
92-
93-
* Import pydantic into base.py and using base.py to access pydantic features
94-
95-
96-
## 0.14.0
97-
98-
### Upgrades
99-
100-
* Make package compatible with pydantic V2
101-
102-
### Refactoring
103-
104-
* Use an import trick to still use pydantic V1 even on environments using pydantic V2
105-
* Centralized pydantic import into base.py in order to avoid having to use import trick on multiple files
106-
107-
### Documentation
108-
109-
* Updated readme to better reflect current state of the pacakge.
110-
* Started a changelog ! :champagne:
111-
* Major change in the doc
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
---
6+
7+
## 🚀 [0.21.0](https://github.com/monggregate/monggregate/releases/tag/v0.21.0) - 2024-04-17
8+
<details>
9+
<summary>Details</summary>
10+
<br>
11+
Identical to 0.21.0b1.
12+
</details>
13+
14+
## 🧪 [0.21.0b1](https://github.com/monggregate/monggregate/releases/tag/v0.21.0b1) - 2024-04-17
15+
<details>
16+
<summary>Details</summary>
17+
<br>
18+
<h3>📖 Documentation</h3>
19+
<p>Improved docstrings in stages and operators.</p>
20+
</details>
21+
22+
## 🧪 [0.21.0b0](https://github.com/monggregate/monggregate/releases/tag/v0.21.0b0) - 2024-01-30
23+
<details>
24+
<summary>Details</summary>
25+
<br>
26+
<h3>✨ New Features</h3>
27+
<p>Implemented <code>VectorSearch</code> pipeline stage.</p>
28+
</details>
29+
30+
---
31+
32+
## 🚀 [0.20.0](https://github.com/monggregate/monggregate/releases/tag/v0.20.0) - 2024-01-27
33+
<details>
34+
<summary>Details</summary>
35+
<br>
36+
<h3>🐛 Bug Fixes</h3>
37+
<p>Fixed bug in <code>Search</code> where some arguments were not properly forwarded to the appropriate operators.</p>
38+
39+
<h3>📖 Documentation</h3>
40+
<p>Added documentation for <code>search</code> and <code>search_meta</code> pipeline stages.</p>
41+
</details>
42+
43+
---
44+
45+
## 🚀 [0.19.1](https://github.com/monggregate/monggregate/releases/tag/v0.19.1) - 2023-12-28
46+
<details>
47+
<summary>Details</summary>
48+
<br>
49+
<h3>🐛 Bug Fixes</h3>
50+
<p>Fixed build, packaging and release process.</p>
51+
</details>
52+
53+
---
54+
55+
## 🚀 [0.19.0](https://github.com/monggregate/monggregate/releases/tag/v0.19.0) - 2023-12-20
56+
<details>
57+
<summary>Details</summary>
58+
<br>
59+
Failed attempt to fix previously broken release.
60+
</details>
61+
62+
---
63+
64+
## 🚀 [0.18.0](https://github.com/monggregate/monggregate/releases/tag/v0.18.0) - 2023-11-12
65+
<details>
66+
<summary>Details</summary>
67+
<br>
68+
<blockquote>⚠️ This release is not available on PyPI as it was broken.</blockquote>
69+
70+
<h3>🐛 Bug Fixes</h3>
71+
<p>Fixed bug preventing use of <code>Compound</code> operator with <code>Search</code> and <code>SearchMeta</code> classes.</p>
72+
73+
<h3>✨ New Features</h3>
74+
<ul>
75+
<li>Pipelinized <code>Search</code> and <code>SearchMeta</code> classes. Complex expressions can now be built step by step by chaining operators.</li>
76+
<li>Updated <code>search</code> method in <code>Pipeline</code> class to ease the use of search stages.</li>
77+
<li>Clarified and simplified faceted search.</li>
78+
</ul>
79+
80+
<h3>♻️ Refactoring</h3>
81+
<ul>
82+
<li>Use operators rather than statement in <code>Compound</code> class.</li>
83+
<li>Factorized <code>Search</code> and <code>SearchMeta</code> classes by creating a <code>SearchBase</code> class.</li>
84+
<li>Use <code>CountOptions</code> rather than raw dicts.</li>
85+
<li>Created <code>AnyStage</code> union type.</li>
86+
</ul>
87+
88+
<h3>📖 Documentation</h3>
89+
<p>Spelling and grammar fixes.</p>
90+
</details>
91+
92+
---
93+
94+
## 🚀 [0.17.0](https://github.com/monggregate/monggregate/releases/tag/v0.17.0) - 2023-10-26
95+
<details>
96+
<summary>Details</summary>
97+
<br>
98+
<h3>📖 Documentation</h3>
99+
<p>First version of the documentation 🍾!</p>
100+
</details>
101+
102+
---
103+
104+
## 🚀 [0.16.2](https://github.com/monggregate/monggregate/releases/tag/v0.16.2) - 2023-09-17
105+
<details>
106+
<summary>Details</summary>
107+
<br>
108+
<h3>🐛 Bug Fixes</h3>
109+
<p>Allow use of iterables and dicts to group by in <code>Group</code> class and pipeline group function.</p>
110+
</details>
111+
112+
---
113+
114+
## 🚀 [0.16.1](https://github.com/monggregate/monggregate/releases/tag/v0.16.1) - 2023-09-08
115+
<details>
116+
<summary>Details</summary>
117+
<br>
118+
<h3>🐛 Bug Fixes</h3>
119+
<p>Fixed <code>replace_root</code> by passing document argument to <code>ReplaceRoot</code> class.</p>
120+
</details>
121+
122+
---
123+
124+
## 🚀 [0.16.0](https://github.com/monggregate/monggregate/releases/tag/v0.16.0) - 2023-08-29
125+
<details>
126+
<summary>Details</summary>
127+
<br>
128+
<h3>✨ New Features</h3>
129+
<ul>
130+
<li>Created <code>S</code> object (represents <code>$</code> sign since it is not a valid variable name in Python) to store all MongoDB operators and to create references to fields.</li>
131+
<li>Created <code>SS</code> object (represents <code>$$</code>) to store aggregation variables and references to user variables.</li>
132+
<li>Interfaced new operators: <code>add</code>, <code>divide</code>, <code>multiply</code>, <code>pow</code>, <code>subtract</code>, <code>cond</code>, <code>if_null</code>, <code>switch</code>, <code>millisecond</code>, <code>date_from_string</code>, <code>date_to_string</code>, <code>type_</code>.</li>
133+
<li>Integrated new operators in <code>Expressions</code> class.</li>
134+
</ul>
135+
136+
<h3>♻️ Refactoring</h3>
137+
<ul>
138+
<li>Redefined <code>Expressions</code> completely. Simplified and clarified how they can be used.</li>
139+
<li>Removed index module from the root of the package (<code>monggregate.index.py</code> → ∅).</li>
140+
<li>Removed expressions subpackage (<code>monggregate.expression</code> → ∅).</li>
141+
<li>Moved expressions fields module to the root (<code>monggregate.expressions.fields.py</code> → <code>monggregate.fields.py</code>).</li>
142+
<li>Removed expressions aggregation_variables module (<code>monggregate.expression.aggregation_variables.py</code> → ∅).</li>
143+
<li>Moved enums to more relevant locations (e.g., <code>OperatorEnum</code> is now in <code>monggregate.operators.py</code>).</li>
144+
</ul>
145+
146+
<h3>💥 Breaking Changes</h3>
147+
<ul>
148+
<li>Operators now return Python objects rather than expressions/statements.</li>
149+
<blockquote><strong>Note</strong>: The wording might change for clarification purposes.
150+
"statement" might be renamed "expression" and "resolve" might be renamed "express".
151+
Some argument names in operators might need to be renamed.</blockquote>
152+
<li>Expressions subpackage has been restructured with some parts being removed.</li>
153+
</ul>
154+
155+
<h3>📖 Documentation</h3>
156+
<p>Updated README to reflect changes in the package, focusing on the recommended usage and clarifying MongoDB operators.</p>
157+
</details>
158+
159+
---
160+
161+
## 🚀 [0.15.0](https://github.com/monggregate/monggregate/releases/tag/v0.15.0) - 2023-08-09
162+
<details>
163+
<summary>Details</summary>
164+
<br>
165+
<h3>🐛 Bug Fixes</h3>
166+
<ul>
167+
<li>Fixed bug in <code>Search.from_operator()</code> classmethod due to recent change in operator type in <code>Search</code> class.</li>
168+
<li>Fixed misspelled operators in constructors map in <code>Search</code> class.</li>
169+
<li>Fixed missing aliases and missing kwargs reduction in some <code>Search</code> operators.</li>
170+
</ul>
171+
</details>
172+
173+
---
174+
175+
## 🚀 [0.14.1](https://github.com/monggregate/monggregate/releases/tag/v0.14.1) - 2023-08-06
176+
<details>
177+
<summary>Details</summary>
178+
<br>
179+
<h3>🐛 Bug Fixes</h3>
180+
<p>Fixed autocompletion.</p>
181+
182+
<h3>♻️ Refactoring</h3>
183+
<p>Import pydantic into <code>base.py</code> and use <code>base.py</code> to access pydantic features.</p>
184+
</details>
185+
186+
---
187+
188+
## 🚀 [0.14.0](https://github.com/monggregate/monggregate/releases/tag/v0.14.0) - 2023-07-23
189+
<details>
190+
<summary>Details</summary>
191+
<br>
192+
<h3>⬆️ Upgrades</h3>
193+
<p>Made package compatible with Pydantic V2.</p>
194+
195+
<h3>♻️ Refactoring</h3>
196+
<ul>
197+
<li>Used an import trick to still use Pydantic V1 even in environments using Pydantic V2.</li>
198+
<li>Centralized pydantic import into <code>base.py</code> to avoid having to use import trick in multiple files.</li>
199+
</ul>
200+
201+
<h3>📖 Documentation</h3>
202+
<ul>
203+
<li>Updated README to better reflect current state of the package.</li>
204+
<li>Started a changelog! 🍾</li>
205+
<li>Major improvements to documentation.</li>
206+
</ul>
207+
</details>
208+
209+
210+
## What about previous versions?
211+
212+
Prior to 0.14.0, the changelog was not kept.

0 commit comments

Comments
 (0)