-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix README and index.md explanations
- Loading branch information
Showing
2 changed files
with
26 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,7 +118,7 @@ class User(mongoz.Document): | |
|
||
Now you can generate some documents and insert them into the database. | ||
|
||
=== "Mongoz" | ||
=== "Simple" | ||
|
||
```python | ||
user = await User.objects.create(name="Mongoz", email="[email protected]") | ||
|
@@ -138,7 +138,7 @@ This will return an instance of a `User` in a Pydantic model and `mypy` will und | |
Since Mongoz was built on the top of Motor, means you can also use the same pattern to query as used | ||
in PyMongo/Motor. | ||
|
||
=== "Mongoz" | ||
=== "Simple" | ||
|
||
```python | ||
user = await User.objects.get(name="Mongoz") | ||
|
@@ -150,12 +150,12 @@ in PyMongo/Motor. | |
user = await User.query({"name": "Mongoz"}).get() | ||
``` | ||
|
||
Or you can use the `User` fields instead of dictionaries. | ||
Or you can use the `User` fields instead of dictionaries (check the "Alternative" for this option). | ||
|
||
=== "Mongoz" | ||
=== "Simple" | ||
|
||
```python | ||
user = await User.objects.filter(name="Mongoz").get() | ||
user = await User.objects.get(name="Mongoz") | ||
``` | ||
|
||
=== "Alternative" | ||
|
@@ -164,9 +164,9 @@ Or you can use the `User` fields instead of dictionaries. | |
user = await User.query({User.name: "Mongoz"}).get() | ||
``` | ||
|
||
Or a more pythonic approach. | ||
Or a more python similar approach (check the "Alternative" for this option). | ||
|
||
=== "Mongoz" | ||
=== "Simple" | ||
|
||
```python | ||
user = await User.objects.get(name="Mongoz") | ||
|
@@ -181,6 +181,12 @@ Or a more pythonic approach. | |
There are plenty of operations you can do with Mongoz and you can see them all throughout the | ||
documentation or in the [Queries](./queries.md) section. | ||
|
||
**Mongoz** praises simplicity and there is no preference in the syntax used within the queries. | ||
You can use what we called "Mongoz" option and the "Alternative" at the same time as both work | ||
really well combined. | ||
|
||
**Both are Mongoz syntaxes but for the sake of the documentation, we classify them with different names for representation purposes only**. | ||
|
||
## Note | ||
|
||
Mongoz document declaration with typing is merely visual. The validations of the fields are not done by the typing of | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,7 +103,7 @@ Use `ipython` to run the following from the console, since it supports `await`. | |
|
||
Now you can generate some documents and insert them into the database. | ||
|
||
=== "Mongoz" | ||
=== "Simple" | ||
|
||
```python | ||
user = await User.objects.create(name="Mongoz", email="[email protected]") | ||
|
@@ -123,7 +123,7 @@ This will return an instance of a `User` in a Pydantic model and `mypy` will und | |
Since Mongoz was built on the top of Motor, means you can also use the same pattern to query as used | ||
in PyMongo/Motor. | ||
|
||
=== "Mongoz" | ||
=== "Simple" | ||
|
||
```python | ||
user = await User.objects.get(name="Mongoz") | ||
|
@@ -135,12 +135,12 @@ in PyMongo/Motor. | |
user = await User.query({"name": "Mongoz"}).get() | ||
``` | ||
|
||
Or you can use the `User` fields instead of dictionaries. | ||
Or you can use the `User` fields instead of dictionaries (**check the "Alternative" for this option**). | ||
|
||
=== "Mongoz" | ||
=== "Simple" | ||
|
||
```python | ||
user = await User.objects.filter(name="Mongoz").get() | ||
user = await User.objects.get(name="Mongoz") | ||
``` | ||
|
||
=== "Alternative" | ||
|
@@ -149,9 +149,9 @@ Or you can use the `User` fields instead of dictionaries. | |
user = await User.query({User.name: "Mongoz"}).get() | ||
``` | ||
|
||
Or a more pythonic approach. | ||
Or a more python similar approach (**check the "Alternative" for this option**). | ||
|
||
=== "Mongoz" | ||
=== "Simple" | ||
|
||
```python | ||
user = await User.objects.get(name="Mongoz") | ||
|
@@ -166,6 +166,12 @@ Or a more pythonic approach. | |
There are plenty of operations you can do with Mongoz and you can see them all throughout the | ||
documentation or in the [Queries](./queries.md) section. | ||
|
||
**Mongoz** praises simplicity and there is no preference in the syntax used within the queries. | ||
You can use what we called "Mongoz" option and the "Alternative" at the same time as both work | ||
really well combined. | ||
|
||
**Both are Mongoz syntaxes but for the sake of the documentation, we classify them with different names for representation purposes only**. | ||
|
||
## Note | ||
|
||
Mongoz document declaration with typing is merely visual. The validations of the fields are not done by the typing of | ||
|