Skip to content

Commit

Permalink
Fix README and index.md explanations
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsil committed Sep 28, 2023
1 parent d5f3826 commit e522096
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]")
Expand All @@ -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")
Expand All @@ -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"
Expand All @@ -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")
Expand All @@ -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
Expand Down
20 changes: 13 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]")
Expand All @@ -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")
Expand All @@ -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"
Expand All @@ -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")
Expand All @@ -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
Expand Down

0 comments on commit e522096

Please sign in to comment.