Skip to content

Commit 896f3fa

Browse files
author
matmoncon
committed
docs: add special projection values to docs
1 parent 68d821e commit 896f3fa

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ What's planned for future releases.
1515
- [ ] Bookmark support
1616
- [ ] Migration CLI for migrating your pyneo4j-ogm models
1717

18+
## 🎯 Features <a name="features"></a>
19+
20+
- [x] **Simple and easy to use**: `pyneo4j-ogm` is designed to be simple and easy to use, while also providing a solid foundation for some more advanced use-cases.
21+
- [x] **Flexible and powerful**: `pyneo4j-ogm` is flexible and powerful. It allows you to do all sorts of things with your data, from simple CRUD operations to complex queries.
22+
- [x] **Fully asynchronous**: `pyneo4j-ogm` is fully asynchronous and uses the `Neo4j Python Driver` under the hood.
23+
- [x] **Supports Neo4j 5+**: `pyneo4j-ogm` supports Neo4j 5+ and is tested against the latest version of Neo4j.
24+
- [x] **Fully typed**: `pyneo4j-ogm` is fully typed out of the box.
25+
- [x] **Powered by Pydantic**: `pyneo4j-ogm` is powered by `Pydantic` and uses it's powerful validation and serialization features under the hood.
26+
1827
## 📦 Installation <a name="installation"></a>
1928

2029
Using [`pip`](https://pip.pypa.io/en/stable/):
@@ -29,15 +38,6 @@ or when using [`Poetry`](https://python-poetry.org/):
2938
poetry add pyneo4j-ogm
3039
```
3140

32-
## 🎯 Features <a name="features"></a>
33-
34-
- [x] **Simple and easy to use**: `pyneo4j-ogm` is designed to be simple and easy to use, while also providing a solid foundation for some more advanced use-cases.
35-
- [x] **Flexible and powerful**: `pyneo4j-ogm` is flexible and powerful. It allows you to do all sorts of things with your data, from simple CRUD operations to complex queries.
36-
- [x] **Fully asynchronous**: `pyneo4j-ogm` is fully asynchronous and uses the `Neo4j Python Driver` under the hood.
37-
- [x] **Supports Neo4j 5+**: `pyneo4j-ogm` supports Neo4j 5+ and is tested against the latest version of Neo4j.
38-
- [x] **Fully typed**: `pyneo4j-ogm` is fully typed out of the box.
39-
- [x] **Powered by Pydantic**: `pyneo4j-ogm` is powered by `Pydantic` and uses it's powerful validation and serialization features under the hood.
40-
4141
## 🚀 Quickstart <a name="quickstart"></a>
4242

4343
Before we can jump right in, we have to take care of some things:
@@ -276,8 +276,8 @@ In the following we are going to take a closer look at the different parts of `p
276276

277277
- [PyNeo4j-OGM](#pyneo4j-ogm)
278278
- [📣 Upcoming features](#-upcoming-features)
279-
- [📦 Installation ](#-installation-)
280279
- [🎯 Features ](#-features-)
280+
- [📦 Installation ](#-installation-)
281281
- [🚀 Quickstart ](#-quickstart-)
282282
- [Full quickstart example](#full-quickstart-example)
283283
- [📚 Documentation ](#-documentation-)
@@ -349,10 +349,10 @@ In the following we are going to take a closer look at the different parts of `p
349349
- [RelationshipProperty.disconnect\_all() ](#relationshippropertydisconnect_all-)
350350
- [RelationshipProperty.replace() ](#relationshippropertyreplace-)
351351
- [RelationshipProperty.find\_connected\_nodes() ](#relationshippropertyfind_connected_nodes-)
352-
- [Filters ](#filters--4)
353-
- [Projections ](#projections--4)
354-
- [Query options ](#query-options--3)
355-
- [Auto-fetching nodes ](#auto-fetching-nodes--3)
352+
- [Filters ](#filters--4)
353+
- [Projections ](#projections--4)
354+
- [Query options ](#query-options--3)
355+
- [Auto-fetching nodes ](#auto-fetching-nodes--3)
356356
- [Hooks with relationship properties ](#hooks-with-relationship-properties-)
357357
- [Queries ](#queries-)
358358
- [Filtering queries ](#filtering-queries-)
@@ -1466,7 +1466,7 @@ print(coffees) # [<Coffee>, <Coffee>, ...]
14661466
print(coffees) # []
14671467
```
14681468

1469-
##### Filters <a name="model-find-many-filters"></a>
1469+
###### Filters <a name="relationship-property-find-connected-nodes-filters"></a>
14701470

14711471
You can pass filters using the `filters` argument to filter the returned nodes. For more about filters, see the [`Filtering queries`](#query-filters) section.
14721472

@@ -1477,7 +1477,7 @@ coffees = await developer.coffee.find_connected_nodes({"sugar": True})
14771477
print(coffees) # [<Coffee sugar=True>, <Coffee sugar=True>, ...]
14781478
```
14791479

1480-
##### Projections <a name="model-find-many-projections"></a>
1480+
###### Projections <a name="relationship-property-find-connected-nodes-projections"></a>
14811481

14821482
`Projections` can be used to only return specific parts of the models as dictionaries. For more information about projections, see the [`Projections`](#query-projections) section.
14831483

@@ -1489,7 +1489,7 @@ coffees = await developer.coffee.find_connected_nodes({"sugar": True}, {"contain
14891489
print(coffees) # [{"contains_sugar": True}, {"contains_sugar": False}, ...]
14901490
```
14911491

1492-
##### Query options <a name="model-find-many-query-options"></a>
1492+
###### Query options <a name="relationship-property-find-connected-nodes-query-options"></a>
14931493

14941494
`Query options` can be used to define how results are returned from the query. They are provided via the `options` argument. For more about query options, see the [`Query options`](#query-options) section.
14951495

@@ -1501,7 +1501,7 @@ coffees = await developer.coffee.find_connected_nodes({"sugar": True}, options={
15011501
print(coffees) # [<Coffee>, <Coffee>, ...]
15021502
```
15031503

1504-
##### Auto-fetching nodes <a name="model-find-many-auto-fetching-nodes"></a>
1504+
###### Auto-fetching nodes <a name="relationship-property-find-connected-nodes-auto-fetching-nodes"></a>
15051505

15061506
The `auto_fetch_nodes` and `auto_fetch_models` parameters can be used to automatically fetch all or selected nodes from defined relationship-properties when running the `find_many()` query. For more about auto-fetching, see [`Auto-fetching relationship-properties`](#query-auto-fetching).
15071507

@@ -1776,7 +1776,7 @@ Projections can help you to reduce bandwidth usage and speed up queries, since y
17761776

17771777
> **Note:** Only top-level mapping is supported. This means that you can not map properties to a nested dictionary key.
17781778
1779-
In the following example, we will return a dictionary with a `dev_name` key, which get's mapped to the models `name` property and a `dev_age` key, which get's mapped to the models `age` property. Any defined mapping which does not exist on the model will have `None` as it's value
1779+
In the following example, we will return a dictionary with a `dev_name` key, which get's mapped to the models `name` property and a `dev_age` key, which get's mapped to the models `age` property. Any defined mapping which does not exist on the model will have `None` as it's value. You can also map the result's `elementId` and `Id` using either `$elementId` or `$id` as the value for the mapped key.
17801780

17811781
```python
17821782
developer = await Developer.find_one({"name": "John"}, {"dev_name": "name", "dev_age": "age", "i_do_not_exist": "some_non_existing_property"})

0 commit comments

Comments
 (0)