diff --git a/gqlalchemy/getting-started.md b/gqlalchemy/getting-started.md
index 904a4260445..dd3613a901a 100644
--- a/gqlalchemy/getting-started.md
+++ b/gqlalchemy/getting-started.md
@@ -30,5 +30,5 @@ guide](/how-to-guides/ogm.md) you can learn how to map Python classes to graph o
### 3. Learn how to use the query builder
There is no need to learn the Cypher query language when you can use the [query
-builder](/how-to-guides/query-builder/create-nodes-relationships.md) in GQLAlchemy to perform
+builder](/how-to-guides/query-builder.md) in GQLAlchemy to perform
the same tasks.
diff --git a/gqlalchemy/how-to-guides/ogm.md b/gqlalchemy/how-to-guides/ogm.md
index 5dad57326c2..d44d479f1d1 100644
--- a/gqlalchemy/how-to-guides/ogm.md
+++ b/gqlalchemy/how-to-guides/ogm.md
@@ -15,8 +15,11 @@ Through this guide, you will learn how to use GQLAlchemy object graph mapper to:
- [**Create indexes**](#create-indexes)
- [**Create constraints**](#create-constraints)
+>Hopefully, this guide will teach you how to properly use GQLAlchemy object graph mapper. If you
+>have any more questions, join our community and ping us on [Discord](https://discord.gg/memgraph).
+
:::info
-To test the above features, you need a running Memgraph instance. If you're not sure how to run Memgraph, check out the Memgraph [Quick start](/memgraph/#quick-start).
+To test the above features, you must [install GQLAlchemy](/gqlalchemy/installation) and have a running Memgraph instance. If you're unsure how to run Memgraph, check out the Memgraph [Quick start](/memgraph/#quick-start).
:::
## Map nodes and relationships
@@ -338,7 +341,7 @@ The indexes will be set on class definition, before instantiation. This ensures
print(db.get_indexes())
```
-To learn more about indexes, head over to the [indexing reference guide](/docs/memgraph/reference-guide/indexing).
+To learn more about indexes, head over to the [indexing reference guide](/memgraph/reference-guide/indexing).
## Create constraints
@@ -355,7 +358,7 @@ The above is the same as running the Cypher query:
CREATE CONSTRAINT ON (n:Language) ASSERT n.name IS UNIQUE;
```
-Read more about it at [uniqueness constraint how-to guide](/docs/memgraph/how-to-guides/constraints/uniqueness-constraint).
+Read more about it at [uniqueness constraint how-to guide](/memgraph/how-to-guides/constraints/uniqueness-constraint).
Existence constraint enforces that each vertex that has a specific label also must have the specified property. Here is how you can **enforce existence constraint** with GQLAlchemy's OGM:
@@ -372,7 +375,7 @@ The above is the same as running the Cypher query:
CREATE CONSTRAINT ON (n:Streamer) ASSERT EXISTS (n.username);
```
-Read more about it at [existence constraint how-to guide](/docs/memgraph/how-to-guides/constraints/existence-constraint).
+Read more about it at [existence constraint how-to guide](/memgraph/how-to-guides/constraints/existence-constraint).
To check which constraints have been created, run:
@@ -449,3 +452,6 @@ except:
print(db.get_indexes())
print(db.get_constraints())
```
+
+>Hopefully, this guide has taught you how to properly use GQLAlchemy object graph mapper. If you
+>have any more questions, join our community and ping us on [Discord](https://discord.gg/memgraph).
diff --git a/gqlalchemy/how-to-guides/overview.md b/gqlalchemy/how-to-guides/overview.md
index 430bd5a46fd..f2ad31073c0 100644
--- a/gqlalchemy/how-to-guides/overview.md
+++ b/gqlalchemy/how-to-guides/overview.md
@@ -22,17 +22,7 @@ To learn more about how to use OGM, take at [**OGM how-to guide**](/how-to-guide
When working with GQLAlchemy, you can connect to the database and execute Cypher
queries using the query builder. To learn more about how to create a query using
-query builder, check out the following how-to guide:
-
-- [**Create nodes and
- relationships**](/how-to-guides/query-builder/create-nodes-relationships.md)
-- [**Return results**](/how-to-guides/query-builder/return-results.md)
-- [**Filter data**](/how-to-guides/query-builder/filter-data.md)
-- [**Call query module
- procedures**](/how-to-guides/query-builder/call-procedures.md)
-- [**Delete and remove
- objects**](/how-to-guides/query-builder/delete-remove-objects.md)
-- [**Set or update objects**](/how-to-guides/query-builder/set-or-update-objects.md)
+query builder, check out the [**query builder how-to guide**](/how-to-guides/query-builder.md).
## Stream & trigger support
diff --git a/gqlalchemy/how-to-guides/query-builder.md b/gqlalchemy/how-to-guides/query-builder.md
new file mode 100644
index 00000000000..d0a814ad73d
--- /dev/null
+++ b/gqlalchemy/how-to-guides/query-builder.md
@@ -0,0 +1,1497 @@
+---
+title: How to use query builder
+sidebar_label: Use query builder
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+Through this guide, you will learn how to use GQLAlchemy query builder to:
+- [**Create nodes and relationships**](#create-nodes-and-relationships)
+ - [**Create a node**](#create-a-node)
+ - [**Create a relationship**](#create-a-relationship)
+- [**Merge nodes and relationships**](#merge-nodes-and-relationships)
+ - [**Merge a node**](#merge-a-node)
+ - [**Merge a relationship**](#merge-a-relationship)
+- [**Set or update properties and labels**](#set-or-update-properties-and-labels)
+ - [**Set a property**](#set-a-property)
+ - [**Set a label**](#set-a-label)
+ - [**Replace all properties**](#replace-all-properties)
+ - [**Update all properties**](#update-all-properties)
+- [**Filter data**](#filter-data)
+ - [**Filter data by property comparison**](#filter-data-by-property-comparison)
+ - [**Filter data by property value**](#filter-data-by-property-value)
+ - [**Filter data by label**](#filter-data-by-label)
+- [**Return results**](#return-results)
+ - [**Return all variables from a query**](#return-all-variables-from-a-query)
+ - [**Return specific variables from a query**](#return-specific-variables-from-a-query)
+ - [**Limit the number of returned results**](#limit-the-number-of-returned-results)
+ - [**Order the returned results**](#order-the-returned-results)
+ - [**Order by a list of values**](#order-by-a-list-of-values)
+- [**Delete and remove objects**](#delete-and-remove-objects)
+ - [**Delete a node**](#delete-a-node)
+ - [**Delete a relationship**](#delete-a-relationship)
+ - [**Remove properties**](#remove-properties)
+- [**Call procedures**](#call-procedures)
+ - [**Call procedure with no arguments**](#call-procedure-with-no-arguments)
+ - [**Call procedure with arguments**](#call-procedure-with-arguments)
+
+>Hopefully, this guide will teach you how to properly use GQLAlchemy query builder. If you
+>have any more questions, join our community and ping us on [Discord](https://discord.gg/memgraph).
+
+:::info
+To test the above features, you must install [GQLAlchemy](/gqlalchemy/installation) and have a running Memgraph instance. If you're unsure how to run Memgraph, check out the Memgraph [Quick start](/memgraph/#quick-start).
+:::
+
+## Create nodes and relationships
+
+Methods [`create()`](/gqlalchemy/reference/query_builders/declarative_base#create), [`merge()`](/gqlalchemy/reference/query_builders/declarative_base#merge), [`match()`](/gqlalchemy/reference/query_builders/declarative_base#match), [`node()`](/gqlalchemy/reference/query_builders/declarative_base#node), [`to()`](/gqlalchemy/reference/query_builders/declarative_base#to) and [`from_()`](/gqlalchemy/reference/query_builders/declarative_base#from_) are most often used when building a query to create or merge nodes and relationships.
+
+### Create a node
+
+To **create a node** with label `Person` and a property `name` of value "Ron", run the following code:
+
+
+
+
+```python
+from gqlalchemy import create
+
+query = create().node(labels="Person", name="Ron").execute()
+```
+
+
+
+
+```cypher
+CREATE (:Person {name: 'Ron'});
+```
+
+
+
+
+### Create a relationship
+
+To **create a relationship** of type `FRIENDS_WITH` with property `since` from one `Person` node to another, run the following code:
+
+
+
+
+```python
+from gqlalchemy import create
+
+query = (
+ create()
+ .node(labels="Person", name="Leslie")
+ .to(relationship_type="FRIENDS_WITH", since="2023-02-16")
+ .node(labels="Person", name="Ron")
+ .execute()
+)
+```
+
+
+
+```cypher
+CREATE (:Person {name: 'Leslie'})-[:FRIENDS_WITH {since: '2023-02-16'}]->(:Person {name: 'Ron'});
+```
+
+
+
+
+Since you are creating a relationship between two nodes, without first matching the existing nodes or merging the relationships, the nodes will be created too.
+
+To **create a relationship** of type `FRIENDS_WITH` from one `Person` node to another **in an opposite direction**, run the following code:
+
+
+
+
+```python
+from gqlalchemy import create
+
+query = (
+ create()
+ .node(labels="Person", name="Leslie")
+ .from(relationship_type="FRIENDS_WITH")
+ .node(labels="Person", name="Ron")
+ .execute()
+)
+```
+
+
+
+```cypher
+CREATE (:Person {name: 'Leslie'})<-[:FRIENDS_WITH]-(:Person {name: 'Ron'});
+```
+
+
+
+
+Again, since you are creating a relationship between two nodes, without first matching the existing nodes or merging the relationships, the nodes will be created too.
+
+To **create a relationship between existing nodes**, first match the existing nodes and then create a relationship by running the following code:
+
+
+
+
+```python
+from gqlalchemy import create, match
+
+query = (
+ match()
+ .node(labels="Person", name="Leslie", variable="leslie")
+ .match()
+ .node(labels="Person", name="Ron", variable="ron")
+ create()
+ .node(variable="leslie")
+ .to(relationship_type="FRIENDS_WITH")
+ .node(variable="ron")
+ .execute()
+)
+```
+
+
+
+```cypher
+MATCH (leslie:Person {name: 'Leslie'})
+MATCH (ron:Person {name: 'Ron'})
+CREATE (leslie)-[:FRIENDS_WITH]->(ron);
+```
+
+
+
+
+Read more about `CREATE` clause in the [Cypher manual](/docs/cypher-manual/clauses/create).
+
+## Merge nodes and relationships
+
+### Merge a node
+
+To **merge a node**, run the following code:
+
+
+
+
+```python
+from gqlalchemy import merge
+
+query = merge().node(labels="Person", name="Leslie").execute()
+```
+
+
+
+
+```cypher
+MERGE (:Person {name: 'Leslie'});
+```
+
+
+
+
+### Merge a relationship
+
+To **merge a relationship**, first match the existing nodes and then merge the relationship by running the following code:
+
+
+
+
+
+```python
+from gqlalchemy import match, merge
+
+query = (
+ match()
+ .node(labels="Person", name="Leslie", variable="leslie")
+ .match()
+ .node(labels="Person", name="Ron", variable="ron")
+ .merge()
+ .node(variable="leslie")
+ .to(relationship_type="FRIENDS_WITH")
+ .node(variable="ron")
+ .execute()
+)
+```
+
+
+
+```cypher
+MATCH (leslie:Person {name: 'Leslie'})
+MATCH (ron:Person {name: 'Ron'})
+MERGE (leslie)-[:FRIENDS_WITH]->(ron);
+```
+
+
+
+
+Read more about `MERGE` clause in the [Cypher manual](/docs/cypher-manual/clauses/merge).
+
+## Set or update properties and labels
+
+The [`set_()`](/gqlalchemy/reference/query_builders/declarative_base#set_) method is used to set labels on nodes, and properties on nodes and relationships. When being set, labels and properties can be updated or created, depending on the operator used as the argument of `set_()` method.
+
+### Set a property
+
+To **set a property** of a graph object use the **assignment operator** from the query builder or a simple equals sign as a string - `"="`.
+
+
+
+
+```python
+from gqlalchemy import match
+from gqlalchemy.query_builders.memgraph_query_builder import Operator
+
+query = (
+ create()
+ .node(labels="Country", variable="c", name="Germany")
+ .set_(item="c.population", operator=Operator.ASSIGNMENT, literal=83000001)
+ .execute()
+)
+```
+
+
+
+
+```cypher
+CREATE (c:Country {name: 'Germany'}) SET c.population = 83000001;
+```
+
+
+
+
+:::info
+`Operator` is an enumeration class defined in the
+[`declarative_base.py`](https://github.com/memgraph/gqlalchemy/blob/main/gqlalchemy/query_builders/declarative_base.py#L84-L94). It can be imported from `gqlalchemy.query_builders.memgraph_query_builder`.
+
+If you don't want to import it, you can use strings `"="`, `">="`, `">"`, `"<>"`, `":"`, `"<"`, `"<="`, `"!="` or `"+="` instead.
+:::
+
+To **set a property of already existing node**, first match the node and then set its property.
+
+
+
+
+```python
+from gqlalchemy import match
+from gqlalchemy.query_builders.memgraph_query_builder import Operator
+
+query = (
+ match()
+ .node(labels="Country", variable="c", name="Germany")
+ .set_(item="c.population", operator=Operator.ASSIGNMENT, literal=10000)
+ .execute()
+)
+```
+
+
+
+
+```cypher
+MATCH (c:Country {name: 'Germany'}) SET c.population = 10000;
+```
+
+
+
+
+To **set multiple properties of a node**, run the following code:
+
+
+
+
+```python
+from gqlalchemy import match
+from gqlalchemy.query_builders.memgraph_query_builder import Operator
+
+query = (
+ match()
+ .node(variable="n")
+ .where(item="n.name", operator="=", literal="Germany")
+ .set_(item="n.population", operator=Operator.ASSIGNMENT, literal=83000001)
+ .set_(item="n.capital", operator=Operator.ASSIGNMENT, literal="Berlin")
+ .execute()
+)
+```
+
+
+
+
+```cypher
+MATCH (n) WHERE n.name = 'Germany' SET n.population = 83000001 SET n.capital = 'Berlin';
+```
+
+
+
+
+If a node already has the properties we are setting, they will be updated to a new value. Otherwise, the properties will be created and their value will be set.
+
+### Set a label
+
+To **set a label of a node**, run the following code:
+
+
+
+
+
+```python
+from gqlalchemy import Match
+from gqlalchemy.query_builders.memgraph_query_builder import Operator
+
+query = Match()
+ .node(variable="c", name="Germany")
+ .set_(item="c", operator=Operator.LABEL_FILTER, expression="Land")
+ .return_()
+ .execute()
+```
+
+
+
+
+```cypher
+MATCH (c {name: 'Germany'}) SET c:Land RETURN *;
+```
+
+
+
+
+If a node already has a label, then it will have both old and new label.
+
+### Replace all properties
+
+With Cypher, it is possible to **replace all properties using a map** within a `SET` clause. Here is how to do it with query builder:
+
+
+
+
+```python
+from gqlalchemy import match
+from gqlalchemy.query_builders.memgraph_query_builder import Operator
+
+query = (
+ match()
+ .node(variable="c", labels="Country")
+ .where(item="c.name", operator="=", literal="Germany")
+ .set_(
+ item="c",
+ operator=Operator.ASSIGNMENT,
+ literal={"country_name": "Germany", "population": 85000000},
+ )
+ .execute()
+)
+```
+
+
+
+```cypher
+MATCH (c:Country) WHERE c.name = 'Germany' SET c = {country_name: 'Germany', population: 85000000};
+```
+
+
+
+
+The properties that are not a part of the graph objects, but are in the map, will be set. The properties that are not in the map, but are a part of the graph objects, will be removed. If a property is both in map and a graph object property, it will be updated to a new value set in map.
+
+### Update all properties
+
+With Cypher, it is also possible to **update all properties using a map** within a `SET` clause by using the **increment operator** (`+=`). Here is how to do it with query builder:
+
+
+
+
+```python
+from gqlalchemy import match
+from gqlalchemy.query_builders.memgraph_query_builder import Operator
+
+query = (
+ match()
+ .node(variable="c", labels="Country")
+ .where(item="c.country_name", operator="=", literal="Germany")
+ .set_(
+ item="c",
+ operator=Operator.INCREMENT,
+ literal={"population": "85000000"},
+ )
+ .execute()
+)
+```
+
+
+
+```cypher
+MATCH (c:Country) WHERE c.country_name = 'Germany' SET c += {population: '85000000'};
+```
+
+
+
+
+All the properties in the map (value of the `literal` argument) that are on a graph object will be updated. The properties that are not on a graph object but are in the map will be added. Properties that are not present in the map will be left as is.
+
+## Filter data
+
+You can use the methods [`where()`](/gqlalchemy/reference/query_builders/declarative_base#where), [`where_not()`](/gqlalchemy/reference/query_builders/declarative_base#where_not), [`or_where()`](/gqlalchemy/reference/query_builders/declarative_base#or_where),
+[`or_where_not()`](/gqlalchemy/reference/query_builders/declarative_base#or_where_node), [`and_where()`](/gqlalchemy/reference/query_builders/declarative_base#and_where), [`and_where_not()`](/gqlalchemy/reference/query_builders/declarative_base#and_where_not), [`xor_where()`](/gqlalchemy/reference/query_builders/declarative_base#xor_where) and
+[`xor_where_not()`](/gqlalchemy/reference/query_builders/declarative_base#xor_where_not) to construct queries that will filter data.
+
+
+
+### Filter data by property comparison
+
+To **filter data by comparing properties** of two nodes, run the following code:
+
+
+
+
+```python
+from gqlalchemy import match
+from gqlalchemy.query_builders.memgraph_query_builder import Operator
+
+results = list(
+ match()
+ .node(labels="Person", variable="p1")
+ .to(relationship_type="FRIENDS_WITH")
+ .node(labels="Person", variable="p2")
+ .where(item="p1.name", operator=Operator.LESS_THAN, expression="p2.name")
+ .return_()
+ .execute()
+)
+
+print(results)
+```
+
+
+
+
+```cypher
+MATCH (p1:Person)-[:FRIENDS_WITH]->(p2:Person) WHERE p1.name < p2.name RETURN *;
+```
+
+
+
+
+Keyword arguments that can be used in filtering methods are `literal` and `expression`. Usually we use `literal` for property values and `expression` for property names and labels. That is because property names and labels shouldn't be quoted in Cypher statements.
+
+:::info
+You will probably see the `GQLAlchemySubclassNotFoundWarning` warning. This happens if you did not define a Python class which maps to a graph object in the database. To do that, check the [object graph mapper how-to guide](/gqlalchemy/how-to-guides/ogm). To ignore such warnings, you can do the following before query execution:
+
+```python
+from gqlalchemy import models
+
+models.IGNORE_SUBCLASSNOTFOUNDWARNING = True
+```
+:::
+
+
+Standard boolean operators like `NOT`, `AND`, `OR` and `XOR` are used in the
+Cypher query language. To have `NOT` within `WHERE` clause, you need to use
+`where_not()` method.
+
+
+
+
+```python
+from gqlalchemy import match
+from gqlalchemy.query_builders.memgraph_query_builder import Operator
+
+results = list(
+ match()
+ .node(labels="Person", variable="p1")
+ .to(relationship_type="FRIENDS_WITH")
+ .node(labels="Person", variable="p2")
+ .where_not(item="p1.name", operator=Operator.LESS_THAN, expression="p2.name")
+ .return_()
+ .execute()
+)
+
+print(results)
+```
+
+
+
+
+```cypher
+MATCH (p1:Person)-[:FRIENDS_WITH]->(p2:Person) WHERE NOT p1.name < p2.name RETURN *;
+```
+
+
+
+
+In a similar way, you can use `AND` and `AND NOT` clauses which correspond to
+the methods `and_where()` and `and_not_where()`. Using the query below you can
+find all persons with the same `address` and `last_name`, but different
+`name`.
+
+
+
+
+```python
+from gqlalchemy import match
+from gqlalchemy.query_builders.memgraph_query_builder import Operator
+
+results = list(
+ match()
+ .node(labels="Person", variable="p1")
+ .to(relationship_type="FRIENDS_WITH")
+ .node(labels="Person", variable="p2")
+ .where(item="p1.address", operator=Operator.EQUAL, expression="p2.address")
+ .and_where(item="p1.last_name", operator=Operator.EQUAL, expression="p2.last_name")
+ .and_not_where(item="p1.name", operator=Operator.EQUAL, expression="p2.name")
+ .return_()
+ .execute()
+)
+
+print(results)
+```
+
+
+
+
+```cypher
+MATCH (p1:Person)-[:FRIENDS_WITH]->(p2:Person)
+WHERE p1.address = p2.address
+AND p1.last_name = p2.last_name
+AND NOT p1.name = p2.name
+RETURN *;
+```
+
+
+
+
+The same goes for the `OR`, `OR NOT`, `XOR` and `XOR NOT` clauses, which
+correspond to the methods `or_where()`, `or_not_where()`, `xor_where()` and
+`xor_not_where()`.
+
+### Filter data by property value
+
+You can **filter data by comparing the property of a graph object to some value** (a
+literal). Below you can see how to compare `age` property of a node to the
+integer.
+
+
+
+
+```python
+from gqlalchemy import match
+from gqlalchemy.query_builders.memgraph_query_builder import Operator
+
+results = list(
+ match()
+ .node(labels="Person", variable="p")
+ .where(item="p.age", operator=Operator.GREATER_THAN, literal=18)
+ .return_()
+ .execute()
+)
+```
+
+
+
+
+```cypher
+MATCH (p:Person) WHERE p.age > 18 RETURN *;
+```
+
+
+
+
+The third keyword argument is `literal` since we wanted the property `age` to be saved as an integer. If we used `expression` keyword argument instead of `literal`, then the `age` property would be a string (it would be quoted in Cypher query). Instead of `Operator.GREATER_THAN`, a simple string of value `">"` can be used.
+
+Just like in [property comparison](#filter-data-by-property-comparison), it is possible to use different boolean operators to further filter the data.
+
+
+
+
+```python
+from gqlalchemy import match
+from gqlalchemy.query_builders.memgraph_query_builder import Operator
+
+results = list(
+ match()
+ .node(labels="Person", variable="p")
+ .where(item="p.age", operator=Operator.GREATER_THAN, literal=18)
+ .or_where(item="p.name", operator=Operator.EQUAL, literal="John")
+ .return_()
+ .execute()
+)
+```
+
+
+
+
+```cypher
+MATCH (p:Person) WHERE p.age > 18 OR p.name = "John" RETURN *;
+```
+
+
+
+
+The `literal` keyword is used again since you want `John` to be quoted in the
+Cypher query (to be saved as a string in the database).
+
+### Filter data by label
+
+Nodes can be filtered by their label using the `WHERE` clause instead of
+specifying it directly in the `MATCH` clause. You have to use `expression` as
+the third keyword argument again since you don't want the quotes surrounding the
+label in the Cypher clause.
+
+To **filter data by label** use the following code:
+
+
+
+
+```python
+from gqlalchemy import match
+from gqlalchemy.query_builders.memgraph_query_builder import Operator
+
+results = list(
+ match()
+ .node(variable="p")
+ .where(item="p", operator=Operator.LABEL_FILTER, expression="Person")
+ .return_()
+ .execute()
+)
+
+print(results)
+```
+
+
+
+
+```cypher
+MATCH (p) WHERE p:Person RETURN *;
+```
+
+
+
+
+Just like in [property comparison](#filter-data-by-property-comparison), it is possible to use different boolean operators to further filter the data.
+
+## Return results
+
+You can use the methods [`return_()`](/gqlalchemy/reference/query_builders/declarative_base#return_), [`limit()`](/gqlalchemy/reference/query_builders/declarative_base#limit), [`skip()`](/gqlalchemy/reference/query_builders/declarative_base#skip) and [`order_by()`](/gqlalchemy/reference/query_builders/declarative_base#order_by) to
+construct queries that will return data from the database.
+
+### Return all variables from a query
+
+To **return all the variables from a query**, use the `return_()` method at the
+end of the query:
+
+
+
+
+```python
+from gqlalchemy import match
+
+results = list(match().node(labels="Person", variable="p").return_().execute())
+print(results)
+```
+
+
+
+
+```cypher
+MATCH (p:Person) RETURN *;
+```
+
+
+
+
+### Return specific variables from a query
+
+To **return only a subset of variables** from a query, specify them in the
+`return_()` method:
+
+
+
+
+```python
+from gqlalchemy import match
+
+results = list(
+ match()
+ .node(labels="Person", variable="p1")
+ .to()
+ .node(labels="Person", variable="p2")
+ .return_(results=[("p1", "first"), "p2"])
+ .execute()
+)
+
+for result in results:
+ print("Here is one pair:")
+ print(result["first"])
+ print(result["p2"])
+```
+
+
+
+
+```cypher
+MATCH (p1:Person)-[]->(p2:Person) RETURN p1 AS first, p2;
+```
+
+
+
+
+### Limit the number of returned results
+
+To **limit the number of returned results**, use the `limit()` method after the
+`return_()` method:
+
+
+
+
+```python
+from gqlalchemy import match
+
+results = list(match().node(labels="Person", variable="p").return_().limit(3).execute())
+print(results)
+```
+
+
+
+
+```cypher
+MATCH (p:Person) RETURN * LIMIT 3;
+```
+
+
+
+
+### Order the returned results
+
+The default ordering in the Cypher query language is ascending (`ASC` or
+`ASCENDING`), and if you want the descending order, you need to add the `DESC`
+or `DESCENDING` keyword to the `ORDER BY` clause.
+
+To **order the return results by one value**, use the `order_by(properties)` method,
+where `properties` can be a string (a property) or a tuple of two strings (a
+property and an order).
+
+The following query will order the results in an ascending (default) order by
+the property `name` of a node.
+
+
+
+
+```python
+from gqlalchemy import match
+
+results = list(
+ match().node(variable="n").return_().order_by(properties="n.name").execute()
+)
+print(results)
+
+```
+
+
+
+
+```cypher
+MATCH (n) RETURN * ORDER BY n.name;
+```
+
+
+
+
+You can also emphasize that you want an ascending order:
+
+
+
+
+```python
+from gqlalchemy import match
+from gqlalchemy.query_builders.memgraph_query_builder import Order
+
+results = list(
+ match()
+ .node(variable="n")
+ .return_()
+ .order_by(properties=("n.name", Order.ASC))
+ .execute()
+)
+print(results)
+```
+
+
+
+
+```cypher
+MATCH (n) RETURN * ORDER BY n.name ASC;
+```
+
+
+
+
+The same can be done with the keyword `ASCENDING`:
+
+
+
+
+```python
+from gqlalchemy import match
+from gqlalchemy.query_builders.memgraph_query_builder import Order
+
+results = list(
+ match()
+ .node(variable="n")
+ .return_()
+ .order_by(properties=("n.name", Order.ASCENDING))
+ .execute()
+)
+print(results)
+```
+
+
+
+
+```cypher
+MATCH (n) RETURN * ORDER BY n.name ASCENDING;
+```
+
+
+
+
+:::info
+`Order` is an enumeration class defined in the
+[`declarative_base.py`](https://github.com/memgraph/gqlalchemy/blob/main/gqlalchemy/query_builders/declarative_base.py#L97-L101). It can be imported from `gqlalchemy.query_builders.memgraph_query_builder`.
+
+If you don't want to import it, you can use strings `"ASC"`, `"ASCENDING"`, `"DESC"` or `"DESCENDING"` instead.
+:::
+
+To order the query results in descending order, you need to specify the `DESC`
+or `DESCENDING` keyword. Hence, the argument of the `order_by()` method must be
+a tuple.
+
+
+
+
+```python
+from gqlalchemy import match
+from gqlalchemy.query_builders.memgraph_query_builder import Order
+
+results = list(
+ match()
+ .node(variable="n")
+ .return_()
+ .order_by(properties=("n.name", Order.DESC))
+ .execute()
+)
+
+print(results)
+```
+
+
+
+
+```cypher
+MATCH (n) RETURN * ORDER BY n.name DESC;
+```
+
+
+
+
+Similarly, you can use `Order.DESCENDING` to get `DESCENDING` keyword in `ORDER BY` clause.
+
+### Order by a list of values
+
+To **order the returned results by more than one value**, use the
+`order_by(properties)` method, where `properties` can be a list of strings or
+tuples of strings (list of properties with or without order).
+
+The following query will order the results in ascending order by the property
+`id`, then again in ascending (default) order by the property `name` of a node.
+After that, it will order the results in descending order by the property
+`last_name`, then in ascending order by the property `age` of a node. Lastly,
+the query will order the results in descending order by the node property
+`middle_name`.
+
+
+
+
+```python
+from gqlalchemy import match
+from gqlalchemy.query_builders.memgraph_query_builder import Order
+
+results = list(
+ match()
+ .node(variable="n")
+ .return_()
+ .order_by(
+ properties=[
+ ("n.id", Order.ASC),
+ "n.name",
+ ("n.last_name", Order.DESC),
+ ("n.age", Order.ASCENDING),
+ ("n.middle_name", Order.DESCENDING),
+ ]
+ )
+ .execute()
+)
+
+print(results)
+```
+
+
+
+
+```cypher
+MATCH (n)
+RETURN *
+ORDER BY n.id ASC, n.name, n.last_name DESC, n.age ASCENDING, n.middle_name DESCENDING;
+```
+
+
+
+
+## Delete and remove objects
+
+You can use the methods [`delete()`](/gqlalchemy/reference/query_builders/declarative_base#delete) and [`remove()`](/gqlalchemy/reference/query_builders/declarative_base#remove) to construct queries that will
+remove nodes and relationships or properties and labels.
+
+### Delete a node
+
+To **delete a node** from the database, use the `delete()` method:
+
+
+
+
+```python
+from gqlalchemy import match
+
+match().node(labels="Person", name="Harry", variable="p").delete(
+ variable_expressions="p"
+).execute()
+```
+
+
+
+
+```cypher
+MATCH (p:Person {name: 'Harry'}) DELETE p;
+```
+
+
+
+
+### Delete a relationship
+
+To **delete a relationship** from the database, use the `delete()` method:
+
+
+
+
+```python
+from gqlalchemy import match
+
+match().node(labels="Person", name="Leslie").to(
+ relationship_type="FRIENDS_WITH", variable="f"
+).node(labels="Person").delete(variable_expressions="f").execute()
+```
+
+
+
+
+```cypher
+MATCH (:Person {name: 'Leslie'})-[f:FRIENDS_WITH]->(:Person) DELETE f;
+```
+
+
+
+
+### Remove properties
+
+To remove a property (or properties) from the database, use the `remove()` method:
+
+
+
+
+```python
+from gqlalchemy import match
+
+match().node(labels="Person", name="Jane", variable="p").remove(
+ items=["p.name", "p.last_name"]
+).execute()
+```
+
+
+
+
+```cypher
+MATCH (p:Person {name: 'Jane'}) REMOVE p.name, p.last_name;
+```
+
+
+
+
+
+## Call procedures
+
+You can use the methods [`call()`](/gqlalchemy/reference/query_builders/declarative_base#call) and [`yield_()`](/gqlalchemy/reference/query_builders/declarative_base#yield_) to construct queries that will
+call procedure and return results from them.
+
+### Call procedure with no arguments
+
+To call a procedure with no arguments, don't specify the arguments in the
+`call()` method:
+
+
+
+
+```python
+from gqlalchemy import call
+
+results = list(call("pagerank.get").yield_().return_().execute())
+print(results)
+```
+
+
+
+
+```cypher
+CALL pagerank.get() YIELD * RETURN *;
+```
+
+
+
+
+### Call procedure with arguments
+
+To call a procedure with arguments, specify the arguments as a string in the
+`call()` method:
+
+
+
+
+```python
+from gqlalchemy import call
+
+results = list(
+ call(
+ "json_util.load_from_url",
+ "'https://download.memgraph.com/asset/mage/data.json'",
+ )
+ .yield_("objects")
+ .return_(results="objects")
+ .execute()
+)
+
+print("Load from URL with argument:", results, "\n")
+```
+
+
+
+
+```cypher
+CALL json_util.load_from_url('https://download.memgraph.com/asset/mage/data.json')
+YIELD objects
+RETURN objects;
+```
+
+
+
+
+## Full code example
+
+```python
+from gqlalchemy import create, merge, Memgraph, match, models, call
+from gqlalchemy.query_builders.memgraph_query_builder import Operator, Order
+
+
+db = Memgraph()
+# clean database
+db.drop_database()
+
+# create nodes and a relationship between them
+
+create().node(labels="Person", name="Leslie").to(relationship_type="FRIENDS_WITH").node(
+ labels="Person", name="Ron"
+).execute()
+
+
+# merge a node
+merge().node(labels="Person", name="Leslie").execute()
+
+# create nodes and a relationship between them
+create().node(
+ labels="Person", name="Jane", last_name="James", address="street", age=19
+).from_(relationship_type="FRIENDS_WITH", since="2023-02-16").node(
+ labels="Person", name="John", last_name="James", address="street", age=8
+).execute()
+
+
+# merge a relationship between existing nodes
+
+match().node(labels="Person", name="Leslie", variable="leslie").match().node(
+ labels="Person", name="Ron", variable="ron"
+).merge().node(variable="leslie").to(relationship_type="FRIENDS_WITH").node(
+ variable="ron"
+).execute()
+
+
+# set a property
+create().node(labels="Country", variable="c", name="Germany").set_(
+ item="c.population", operator=Operator.ASSIGNMENT, literal=83000001
+).execute()
+
+# update a property
+match().node(labels="Country", variable="c", name="Germany").set_(
+ item="c.population", operator=Operator.ASSIGNMENT, literal=10000
+).execute()
+
+
+# update multiple properties
+match().node(variable="n").where(item="n.name", operator="=", literal="Germany").set_(
+ item="n.population", operator=Operator.ASSIGNMENT, literal=83000001
+).set_(item="n.capital", operator=Operator.ASSIGNMENT, literal="Berlin").execute()
+
+
+# replace all properties
+match().node(variable="c", labels="Country").where(
+ item="c.name", operator="=", literal="Germany"
+).set_(
+ item="c",
+ operator=Operator.ASSIGNMENT,
+ literal={"country_name": "Germany", "population": 85000000},
+).execute()
+
+
+# update multiple properties
+
+match().node(variable="c", labels="Country").where(
+ item="c.country_name", operator="=", literal="Germany"
+).set_(
+ item="c",
+ operator=Operator.INCREMENT,
+ literal={"population": "85000000"},
+).execute()
+
+
+models.IGNORE_SUBCLASSNOTFOUNDWARNING = True
+
+results = list(
+ match()
+ .node(labels="Person", variable="p1")
+ .to(relationship_type="FRIENDS_WITH")
+ .node(labels="Person", variable="p2")
+ .where(item="p1.name", operator=Operator.LESS_THAN, expression="p2.name")
+ .return_()
+ .execute()
+)
+
+print("Filter by property comparison:", results, "\n")
+
+results = list(
+ match()
+ .node(labels="Person", variable="p1")
+ .to(relationship_type="FRIENDS_WITH")
+ .node(labels="Person", variable="p2")
+ .where_not(item="p1.name", operator=Operator.LESS_THAN, expression="p2.name")
+ .return_()
+ .execute()
+)
+
+print("Filter by property comparison (negation):", results, "\n")
+
+results = list(
+ match()
+ .node(labels="Person", variable="p1")
+ .to(relationship_type="FRIENDS_WITH")
+ .node(labels="Person", variable="p2")
+ .where(item="p1.address", operator=Operator.EQUAL, expression="p2.address")
+ .and_where(item="p1.last_name", operator=Operator.EQUAL, expression="p2.last_name")
+ .and_not_where(item="p1.name", operator=Operator.EQUAL, expression="p2.name")
+ .return_()
+ .execute()
+)
+
+print("Filter by property comparison + logical operators:", results, "\n")
+
+results = list(
+ match()
+ .node(labels="Person", variable="p")
+ .where(item="p.age", operator=Operator.GREATER_THAN, literal=18)
+ .return_()
+ .execute()
+)
+
+print("Filter by property value:", results, "\n")
+
+results = list(
+ match()
+ .node(labels="Person", variable="p")
+ .where(item="p.age", operator=Operator.GREATER_THAN, literal=18)
+ .or_where(item="p.name", operator=Operator.EQUAL, literal="John")
+ .return_()
+ .execute()
+)
+
+print("Filter by property value + logical operators:", results, "\n")
+
+results = list(
+ match()
+ .node(variable="p")
+ .where(item="p", operator=Operator.LABEL_FILTER, expression="Person")
+ .return_()
+ .execute()
+)
+
+print("Filter by label:", results, "\n")
+
+
+results = list(match().node(labels="Person", variable="p").return_().execute())
+print("Return all:", results, "\n")
+
+results = list(
+ match()
+ .node(labels="Person", variable="p1")
+ .to()
+ .node(labels="Person", variable="p2")
+ .return_(results=[("p1", "first"), "p2"])
+ .execute()
+)
+
+for result in results:
+ print("Here is one pair:")
+ print(result["first"])
+ print(result["p2"])
+
+print()
+
+results = list(match().node(labels="Person", variable="p").return_().limit(3).execute())
+print("Limit results:", results, "\n")
+
+
+results = list(
+ match().node(variable="n").return_().order_by(properties="n.name").execute()
+)
+print("Order descending:", results, "\n")
+
+results = list(
+ match()
+ .node(variable="n")
+ .return_()
+ .order_by(properties=("n.name", Order.ASCENDING))
+ .execute()
+)
+print("Order ascending:", results, "\n")
+
+results = list(
+ match()
+ .node(variable="n")
+ .return_()
+ .order_by(properties=("n.name", Order.DESC))
+ .execute()
+)
+
+print("Order descending with ordering:", results, "\n")
+
+results = list(
+ match()
+ .node(variable="n")
+ .return_()
+ .order_by(
+ properties=[
+ ("n.id", Order.ASC),
+ "n.name",
+ ("n.last_name", Order.DESC),
+ ("n.age", Order.ASCENDING),
+ ("n.middle_name", Order.DESCENDING),
+ ]
+ )
+ .execute()
+)
+
+print("Mix of ordering:", results, "\n")
+
+
+# create a node to delete
+create().node(labels="Person", name="Harry").execute()
+
+# delete a node
+match().node(labels="Person", name="Harry", variable="p").delete(
+ variable_expressions="p"
+).execute()
+
+# delete a relationship between Leslie and her friends
+match().node(labels="Person", name="Leslie").to(
+ relationship_type="FRIENDS_WITH", variable="f"
+).node(labels="Person").delete(variable_expressions="f").execute()
+
+# remove name and last_name properties from Jane
+match().node(labels="Person", name="Jane", variable="p").remove(
+ items=["p.name", "p.last_name"]
+).execute()
+
+# calculate PageRank
+results = list(call("pagerank.get").yield_().return_().execute())
+print("PageRank:", results, "\n")
+
+# Load JSON from URL with arguments
+results = list(
+ call(
+ "json_util.load_from_url",
+ "'https://download.memgraph.com/asset/mage/data.json'",
+ )
+ .yield_("objects")
+ .return_(results="objects")
+ .execute()
+)
+
+print("Load from URL with argument:", results, "\n")
+```
+
+
+>Hopefully, this guide has taught you how to properly use GQLAlchemy query builder. If you
+>have any more questions, join our community and ping us on [Discord](https://discord.gg/memgraph).
+
diff --git a/gqlalchemy/how-to-guides/query-builder/call-procedures.md b/gqlalchemy/how-to-guides/query-builder/call-procedures.md
deleted file mode 100644
index 6dfa19ddcc2..00000000000
--- a/gqlalchemy/how-to-guides/query-builder/call-procedures.md
+++ /dev/null
@@ -1,77 +0,0 @@
----
-id: call-procedures
-title: How to call procedures
-sidebar_label: Call procedures
----
-
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-You can use the methods `call()` and `yield_()` to construct queries that will
-call procedure and return results from them.
-
-- `call(procedure: str, arguments: Optional[str] = None)` - Call the procedure
- `procedure` with the arguments `arguments`.
-- `yield_(results: Optional[Dict[str, str]])` - Yield results from a procedure
- with aliases formatted as `key AS value`.
-
-## Call procedure with no arguments
-
-To call a procedure with no arguments, don't specify the arguments in the
-`call()` method:
-
-
-
-
-```python
-from gqlalchemy import Call
-
-query = Call("pagerank.get").yield_().return_().execute()
-```
-
-
-
-
-```cypher
-CALL pagerank.get() YIELD * RETURN *;
-```
-
-
-
-
-## Call procedure with arguments
-
-To call a procedure with arguments, specify the arguments as a string in the
-`call()` method:
-
-
-
-
-```python
-from gqlalchemy import Call
-
-query = Call("json_util.load_from_url", "https://some-url.com")
- .yield_(results="objects")
- .return_(results="objects")
- .execute()
-```
-
-
-
-
-```cypher
-CALL json_util.load_from_url("https://some-url.com") YIELD objects RETURN objects;
-```
-
-
-
diff --git a/gqlalchemy/how-to-guides/query-builder/create-nodes-relationships.md b/gqlalchemy/how-to-guides/query-builder/create-nodes-relationships.md
deleted file mode 100644
index bdef1681339..00000000000
--- a/gqlalchemy/how-to-guides/query-builder/create-nodes-relationships.md
+++ /dev/null
@@ -1,105 +0,0 @@
----
-id: create-nodes-relationships
-title: Create nodes and relationships
-sidebar_label: Create nodes and relationships
----
-
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-You can use the methods `create()` and `merge()` to construct queries that will
-generate new nodes and relationships in the database.
-
-- `create()` - Creates the specified node or relationship.
-- `merge()` - Updates existing nodes and relationships or creates them if they
- don't exist.
-
-## How to create a node
-
-To create nodes, you can just use the method `node()` after `create()`:
-
-
-
-
-```python
-from gqlalchemy import Create
-
-query = Create().node(labels="Person", name="Ron").execute()
-```
-
-
-
-
-```cypher
-CREATE (:Person {name: 'Ron'});
-```
-
-
-
-
-## How to create a node if it doesn't exist
-
-If you use the `merge()` method instead of `create()`, the node won't be created
-if it already exists, it will only be updated if the properties don't match:
-
-
-
-
-```python
-from gqlalchemy import Merge
-
-query = Merge().node(labels="Person", name="Leslie").execute()
-```
-
-
-
-
-```cypher
-MERGE (:Person {name: 'Leslie'});
-```
-
-
-
-
-## How to create a relationship
-
-To create relationships, you can just use the methods `to()` and `from()` after
-`create()`:
-
-
-
-
-```python
-from gqlalchemy import Create
-
-query = Create()
- .node(labels="Person", name="Leslie")
- .to(relationship_type="FRIENDS_WITH")
- .node(labels="Person", name="Ron")
- .execute()
-```
-
-
-
-
-```cypher
-CREATE (:Person {name: 'Leslie'})-[:FRIENDS_WITH]->(:Person {name: 'Ron'});
-```
-
-
-
diff --git a/gqlalchemy/how-to-guides/query-builder/delete-remove-objects.md b/gqlalchemy/how-to-guides/query-builder/delete-remove-objects.md
deleted file mode 100644
index 8017517348a..00000000000
--- a/gqlalchemy/how-to-guides/query-builder/delete-remove-objects.md
+++ /dev/null
@@ -1,110 +0,0 @@
----
-id: delete-remove-objects
-title: How to delete and remove objects
-sidebar_label: Delete and remove objects
----
-
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-You can use the methods `delete()` and `remove()` to construct queries that will
-remove nodes and relationships or remove properties and labels.
-
-- `delete(variable_expressions: Union[str, List[str]], detach: Optional[bool] = False)` -
- Remove nodes and relationships. Set the argument `detach` to true in order to
- delete nodes with their relationships.
-- `remove(items: Union[str, List[str]])` - Remove properties and labels.
-
-## Delete nodes
-
-To delete a node from the database, use the `delete()` method:
-
-
-
-
-```python
-from gqlalchemy import Match
-
-query = Match()
- .node(labels="Person", variable="p")
- .delete(variable_expressions="p")
- .execute()
-```
-
-
-
-
-```cypher
-MATCH (p:Person) DELETE p;
-```
-
-
-
-
-## Delete relationships
-
-To delete a relationship from the database, use the `delete()` method:
-
-
-
-
-```python
-from gqlalchemy import match
-
-query = Match()
- .node(labels="Person")
- .to(relationship_type="FRIENDS_WITH", variable="f")
- .node(labels="Person")
- .delete(variable_expressions="f")
- .execute()
-```
-
-
-
-
-```cypher
-MATCH (:Person)-[f:FRIENDS_WITH]->(:Person) DELETE f;
-```
-
-
-
-
-## Remove properties
-
-To remove a property (or properties) from the database, use the `remove()` method:
-
-
-
-
-```python
-from gqlalchemy import Match
-
-query = Match()
- .node(labels="Person", variable="p")
- .remove(items=["p.name", "p.last_name"])
-```
-
-
-
-
-```cypher
-MATCH (p:Person) REMOVE p.name;
-```
-
-
-
diff --git a/gqlalchemy/how-to-guides/query-builder/filter-data.md b/gqlalchemy/how-to-guides/query-builder/filter-data.md
deleted file mode 100644
index 1bfd67a19c0..00000000000
--- a/gqlalchemy/how-to-guides/query-builder/filter-data.md
+++ /dev/null
@@ -1,265 +0,0 @@
----
-id: filter-data
-title: How to filter data
-sidebar_label: Filter data
----
-
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-You can use the methods `where()`, `where_not()`, `or_where()`,
-`or_where_not()`, `and_where()`, `and_where_not()`, `xor_where()` and
-`xor_where_not()` to construct queries that will filter data.
-
-- `where(self, item: str, operator: Operator, **kwargs)` - Filter data so that
- `operator` evaluates the comparison of `item` and `literal` or `expression` to true.
-- `where_not(self, item: str, operator: Operator, **kwargs)` - Filter data so that
- `operator` evaluates the comparison of `item` and `literal` or `expression` to false.
-- `or_where(self, item: str, operator: Operator, **kwargs)` - Append an additional
- filter with `OR`.
-- `or_not_where(self, item: str, operator: Operator, **kwargs)` - Append an additional
- filter with `OR NOT`.
-- `and_where(self, item: str, operator: Operator, **kwargs)` - Append an additional
- filter with `AND`.
-- `and_not_where(self, item: str, operator: Operator, **kwargs)` - Append an additional
- filter with `AND NOT`.
-- `xor_where(self, item: str, operator: Operator, **kwargs)` - Append an additional
- filter with `XOR`.
-- `xor_not_where(self, item: str, operator: Operator, **kwargs)` - Append an additional
- filter with `XOR NOT`.
-
-In this guide, you'll learn how to:
-
-- [Filter data by property comparison](#filter-data-by-property-comparison)
-- [Filter data by property value](#filter-data-by-property-value)
-- [Filter data by label](#filter-data-by-label)
-
-## Filter data by property comparison
-
-You can filter data by comparing properties of graph objects. Below you can see
-how to compare `name` properties of two nodes.
-
-
-
-
-```python
-from gqlalchemy import Match
-from gqlalchemy.query_builders.memgraph_query_builder import Operator
-
-query = Match()
- .node(labels="Person", variable="p1")
- .to(relationship_type="FRIENDS_WITH")
- .node(labels="Person", variable="p2")
- .where(item="p1.name", operator=Operator.EQUAL, expression="p2.name")
- .return_()
- .execute()
-```
-
-
-
-
-```cypher
-MATCH (p1:Person)-[:FRIENDS_WITH]->(p2:Person) WHERE p1.name = p2.name RETURN *;
-```
-
-
-
-
-Here the `expression` keyword argument is used because the property shouldn't be
-quoted in the Cypher query.
-
-Standard boolean operators like `NOT`, `AND`, `OR` and `XOR` are used in the
-Cypher query language. To have `NOT` within `WHERE` clause, you need to use
-`where_not()` method.
-
-
-
-
-```python
-from gqlalchemy import Match
-from gqlalchemy.query_builders.memgraph_query_builder import Operator
-
-query = Match()
- .node(labels="Person", variable="p1")
- .to(relationship_type="FRIENDS_WITH")
- .node(labels="Person", variable="p2")
- .where_not(item="p1.name", operator=Operator.EQUAL, expression="p2.name")
- .return_()
- .execute()
-```
-
-
-
-
-```cypher
-MATCH (p1:Person)-[:FRIENDS_WITH]->(p2:Person) WHERE NOT p1.name = p2.name RETURN *;
-```
-
-
-
-
-In a similar way, you can use `AND` and `AND NOT` clauses, which correspond to
-the methods `and_where()` and `and_not_where()`. Using the query below you can
-find all persons with the same `first_name` and `last_name`, but different
-`address`.
-
-
-
-
-```python
-from gqlalchemy import Match
-from gqlalchemy.query_builders.memgraph_query_builder import Operator
-
-query = Match()
- .node(labels="Person", variable="p1")
- .to(relationship_type="FRIENDS_WITH")
- .node(labels="Person", variable="p2")
- .where(item="p1.first_name", operator=Operator.EQUAL, expression="p2.first_name")
- .and_where(item="p1.last_name", operator=Operator.EQUAL, expression="p2.last_name")
- .and_not_where(item="p1.address", operator=Operator.EQUAL, expression="p2.address")
- .return_()
- .execute()
-```
-
-
-
-
-```cypher
-MATCH (p1:Person)-[:FRIENDS_WITH]->(p2:Person) WHERE p1.name = p2.name AND p1.last_name = p2.last_name AND NOT p1.address = p2.address RETURN *;
-```
-
-
-
-
-The same goes for the `OR`, `OR NOT`, `XOR` and `XOR NOT` clauses, which
-correspond to the methods `or_where()`, `or_not_where()`, `xor_where()` and
-`xor_not_where()`.
-
-## Filter data by property value
-
-You can filter data by comparing the property of a graph object to some value (a
-literal). Below you can see how to compare `age` property of a node to the
-integer.
-
-
-
-
-```python
-from gqlalchemy import Match
-
-query = Match()
- .node(labels="Person", variable="p")
- .where(item="p.age", operator=">", literal=18)
- .return_()
- .execute()
-```
-
-
-
-
-```cypher
-MATCH (p:Person) WHERE p.age > 18 RETURN *;
-```
-
-
-
-
-It's important that the third keyword argument is `literal`, since then, it will
-be of the correct type.
-
-Just like in [property comparison](#filter-data-by-property-comparison), you can
-use different boolean operators to further filter the data.
-
-
-
-
-```python
-from gqlalchemy import Match
-from gqlalchemy.query_builders.memgraph_query_builder import Operator
-
-query = Match()
- .node(labels="Person", variable="p")
- .where(item="p.age", operator=Operator.GREATER_THAN, literal=18)
- .or_where(item="p.name", operator=Operator.EQUAL, literal="John")
- .return_()
- .execute()
-```
-
-
-
-
-```cypher
-MATCH (p:Person) WHERE p.age > 18 OR p.name = "John" RETURN *;
-```
-
-
-
-
-The `literal` keyword is used again since you want `John` to be quoted in the
-Cypher query.
-
-## Filter data by label
-
-Nodes can be filtered by their label using the `WHERE` clause instead of
-specifying it directly in the `MATCH` clause. You have to use `expression` as
-the third keyword argument again since you don't want the quotes surrounding the
-label in the Cypher clause.
-
-Below you can see an example of how to filter data by label:
-
-
-
-
-```python
-from gqlalchemy import Match
-from gqlalchemy.query_builders.memgraph_query_builder import Operator
-
-query = Match()
- .node(variable="p")
- .where(item="p", operator=Operator.LABEL_FILTER, expression="Person")
- .return_()
- .execute()
-```
-
-
-
-
-```cypher
-MATCH (p) WHERE p:Person RETURN *;
-```
-
-
-
-
-Just like in [property comparison](#filter-data-by-property-comparison), you can
-use different boolean operators to further filter the data.
diff --git a/gqlalchemy/how-to-guides/query-builder/return-results.md b/gqlalchemy/how-to-guides/query-builder/return-results.md
deleted file mode 100644
index a5cd539879a..00000000000
--- a/gqlalchemy/how-to-guides/query-builder/return-results.md
+++ /dev/null
@@ -1,302 +0,0 @@
----
-id: return-results
-title: How to return results
-sidebar_label: Return results
----
-
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-You can use the methods `return_()`, `limit()`, `skip()` and `order_by()` to
-construct queries that will return data from the database.
-
-- `return_(results: Optional[Union[str, Tuple[str, str], Dict[str, str],
- List[Union[str, Tuple[str, str]]], Set[Union[str, Tuple[str, str]]]]] =
- None)` - Return data from the database with aliases formatted as `key AS
- value`.
-- `limit(integer_expression: Union[str, int])` - Limits the number of returned results equal
- to `integer_expression`.
-- `skip(integer_expression: Union[str, int])` - Skip the number of results to be returned
- equal to `integer_expression`.
-- `order_by(properties: Union[str, Tuple[str, Order], List[Union[str, Tuple[str,
- Order]]]])` - Order the returned results either descending or ascending.
-
-## Return all variables from a query
-
-To return all the variables from a query, just use the `return_()` method at the
-end of your query:
-
-
-
-
-```python
-from gqlalchemy import Match
-
-query = Match().node(labels="Person", variable="p").return_().execute()
-```
-
-
-
-
-```cypher
-MATCH (p:Person) RETURN *;
-```
-
-
-
-
-## Return specific variables from a query
-
-To return only a subset of variables from a query, specify them in the
-`return()` method:
-
-
-
-
-```python
-from gqlalchemy import Match
-
-query = Match()
- .node(labels="Person", variable="p1")
- .to()
- .node(labels="Person", variable="p2")
- .return_(results=[("p1", "first"), "p2"])
- .execute()
-```
-
-
-
-
-```cypher
-MATCH (p1:Person)-[]->(p2:Person) RETURN p1 AS first, p2;
-```
-
-
-
-
-## Limit the number of returned results
-
-To limit the number of returned results, use the `limit()` method after the
-`return_()` method:
-
-
-
-
-```python
-from gqlalchemy import Match
-
-query = match().node(labels="Person", variable="p").return_().limit(10).execute()
-```
-
-
-
-
-```cypher
-MATCH (p:Person) RETURN * LIMIT 10;
-```
-
-
-
-
-## Order the returned results
-
-You can order the returned results [by one](#order-by-one-value) or [more
-values](#order-by-list-of-values) in an ascending or descending order. The
-default ordering in the Cypher query language is ascending (`ASC` or
-`ASCENDING`), and if you want the descending order, you need to add the `DESC`
-or `DESCENDING` keyword to the `ORDER BY` clause.
-
-### Order by one value
-
-To order the return results by one value, use the `order_by(properties)` method,
-where `properties` can be a string (a property) or a tuple of two strings (a
-property and an order).
-
-The following query will order the results in an ascending (default) order by
-the property `id` of a node.
-
-
-
-
-```python
-from gqlalchemy import Match
-
-query = Match().node(variable="n").return_().order_by(properties="n.id").execute()
-```
-
-
-
-
-```cypher
-MATCH (n) RETURN * ORDER BY n.id;
-```
-
-
-
-
-You can also emphasize that you want an ascending order:
-
-
-
-
-```python
-from gqlalchemy import Match
-from gqlalchemy.query_builders.memgraph_query_builder import Order
-
-query = Match().node(variable="n").return_().order_by(properties=("n.id", Order.ASC).execute()
-```
-
-
-
-
-```cypher
-MATCH (n) RETURN * ORDER BY n.id ASC;
-```
-
-
-
-
-The same can be done with the keyword `ASCENDING`:
-
-
-
-
-```python
-from gqlalchemy import Match
-from gqlalchemy.query_builders.memgraph_query_builder import Order
-
-query = Match().node(variable="n").return_().order_by(properties=("n.id", Order.ASCENDING).execute()
-```
-
-
-
-
-```cypher
-MATCH (n) RETURN * ORDER BY n.id ASCENDING;
-```
-
-
-
-
-:::info
-
-`Order` is an enumeration class defined in the
-[`query_module.py`](https://github.com/memgraph/gqlalchemy/blob/main/gqlalchemy/query_builder.py).
-It will help you in adding the correct order. If you don't want to import it,
-you can use strings: `"ASC"`, `"ASCENDING"`, `"DESC"` or `"DESCENDING"`.
-
-:::
-
-To order the query results in descending order, you need to specify the `DESC`
-or `DESCENDING` keyword. Hence, the argument of the `order_by()` method must be
-a tuple.
-
-
-
-
-```python
-from gqlalchemy import Match
-from gqlalchemy.query_builders.memgraph_query_builder import Order
-
-query = Match().node(variable="n").return_().order_by(properties=("n.id", Order.DESC).execute()
-```
-
-
-
-
-```cypher
-MATCH (n) RETURN * ORDER BY n.id DESC;
-```
-
-
-
-
-Similarly, you can use `Order.DESCENDING` to get `DESCENDING` keyword in `ORDER BY` clause.
-
-### Order by a list of values
-
-To order the returned results by more than one value, use the
-`order_by(properties)` method, where `properties` can be a list of strings or
-tuples of strings (list of properties with or without order).
-
-The following query will order the results in ascending order by the property
-`id`, then again in ascending (default) order by the property `name` of a node.
-After that, it will order the results in descending order by the property
-`last_name`, then in ascending order by the property `age` of a node. Lastly,
-the query will order the results in descending order by the node property
-`middle_name`.
-
-
-
-
-```python
-from gqlalchemy import Match
-from gqlalchemy.query_builders.memgraph_query_builder import Order
-
-query = Match()
- .node(variable="n")
- .return_()
- .order_by(
- properties=[
- ("n.id", Order.ASC),
- "n.name",
- ("n.last_name", Order.DESC),
- ("n.age", Order.ASCENDING),
- ("n.middle_name", Order.DESCENDING),
- ]
- )
-```
-
-
-
-
-```cypher
-MATCH (n) RETURN * ORDER BY n.id ASC, n.name, n.last_name DESC, n.age ASCENDING, n.middle_name DESCENDING;
-```
-
-
-
-
-Hopefully, this guide has taught you how to return the query results. If you
-have any more questions, join our community and ping us on
-[Discord](https://www.discord.gg/memgraph).
diff --git a/gqlalchemy/how-to-guides/query-builder/set-or-update-objects.md b/gqlalchemy/how-to-guides/query-builder/set-or-update-objects.md
deleted file mode 100644
index 0f1d3c7bb4e..00000000000
--- a/gqlalchemy/how-to-guides/query-builder/set-or-update-objects.md
+++ /dev/null
@@ -1,203 +0,0 @@
----
-id: set-or-update-objects
-title: How to set or update objects
-sidebar_label: Set or update objects
----
-
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-
-The `set_()` method is used to set or update labels on nodes, and properties on
-nodes and relationships.
-
-- `set_(self, item: str, operator: Operator, **kwargs)` - sets or updates the
- value of item to `literal` or `expression` value, depending on the `operator`.
-
-## Set or update a property
-
-You can assign a value to a node property with the query builder's `set_()`
-method. The used assignment operator is imported from the query builder. You can
-also use a simple equals sign as a string - `"="`.
-
-
-
-
-```python
-from gqlalchemy import Match
-from gqlalchemy.query_builders.memgraph_query_builder import Operator
-
-query = Match()
- .node(labels="Country", variable="c", name="Germany")
- .set_(item="c.population", operator=Operator.ASSIGNMENT, literal=83000001)
- .return_()
- .execute()
-```
-
-
-
-
-```cypher
-MATCH (c:Country {name: 'Germany'}) SET c.population = 83000001 RETURN *;
-```
-
-
-
-
-If the node already had the `population` property, it will be updated by setting
-it to a new value.
-
-## Set or update multiple properties
-
-
-
-
-```python
-from gqlalchemy import Match
-from gqlalchemy.query_builders.memgraph_query_builder import Operator
-
-query = Match()
- .node(variable='n')
- .where(item='n.name', operator='=', literal='Germany')
- .set_(item='n.population', operator=Operator.ASSIGNMENT, literal=83000001)
- .set_(item='n.capital', operator=Operator.ASSIGNMENT, literal='Berlin')
- .return_()
- .execute()
-```
-
-
-
-
-```cypher
-MATCH (n) WHERE n.name = 'Germany' SET n.population = 83000001 SET n.capital = 'Berlin' RETURN *;
-```
-
-
-
-
-If the node already had the `population` or `capital` properties, they will be
-updated to a new value.
-
-## Set a label
-
-The `set()` method can be used to set a label of a node. If a node already
-has a label, then it will have both old and new label.
-
-
-
-
-```python
-from gqlalchemy import Match
-from gqlalchemy.query_builders.memgraph_query_builder import Operator
-
-query = Match()
- .node(variable="c", name="Germany")
- .set_(item="c", operator=Operator.LABEL_FILTER, expression="Land")
- .return_()
- .execute()
-```
-
-
-
-
-```cypher
-MATCH (c {name: 'Germany'}) SET c:Land RETURN *;
-```
-
-
-
-
-## Replace all properties using map
-
-If `set()` is used with the `Operator.ASSIGNMENT` (`=`), all the properties
-in the map (value of the `literal` argument) that are on the node or
-relationship will be updated. The properties that are not on the node or
-relationship but are in the map will be added. The properties that are not in
-the map will be removed.
-
-
-
-
-```python
-from gqlalchemy import Match
-from gqlalchemy.query_builders.memgraph_query_builder import Operator
-
-query = Match()
- .node(variable='c', labels='Country')
- .where(item='c.name', operator='=', literal='Germany')
- .set_(item='c', operator=Operator.ASSIGNMENT, literal={'name': 'Germany', 'population': '85000000'})
- .return_()
- .execute()
-```
-
-
-
-```cypher
-MATCH (c:Country) WHERE c.name = 'Germany' SET c = {name: 'Germany', population: '85000000'} RETURN *;
-```
-
-
-
-
-## Update all properties using map
-
-If `set()` is used with the `Operator.INCREMENT` (`+=`), all the properties
-in the map (value of the `literal` argument) that are on the node or
-relationship will be updated. The properties that are not on the node or
-relationship but are in the map will be added. Properties that are not present
-in the map will be left as is.
-
-
-
-
-```python
-from gqlalchemy import Match
-from gqlalchemy.query_builders.memgraph_query_builder import Operator
-
-query = Match()
- .node(variable='c', labels='Country')
- .where(item='c.name', operator='=', literal='Germany')
- .set_(item='c', operator=Operator.INCREMENT, literal={'name': 'Germany', 'population': '85000000'})
- .return_()
- .execute()
-```
-
-
-
-```cypher
-MATCH (c:Country) WHERE c.name = 'Germany' SET c += {name: 'Germany', population: '85000000'} RETURN *;
-```
-
-
-
-
-
-Hopefully, this guide has taught you how to set or update node label or node and
-relationship properties. For more information on what you can do with `SET`
-clause, check out the [Cypher manual](/cypher-manual/clauses/set). If you
-have any more questions, join our community and ping us on
-[Discord](https://discord.gg/memgraph).
diff --git a/sidebars/sidebarsGQLAlchemy.js b/sidebars/sidebarsGQLAlchemy.js
index 741ff9f200c..fdf87b3949f 100644
--- a/sidebars/sidebarsGQLAlchemy.js
+++ b/sidebars/sidebarsGQLAlchemy.js
@@ -13,16 +13,9 @@ module.exports = {
id: "how-to-guides/ogm",
},
{
- type: "category",
+ type: "doc",
label: "Use query builder",
- items: [
- "how-to-guides/query-builder/create-nodes-relationships",
- "how-to-guides/query-builder/return-results",
- "how-to-guides/query-builder/filter-data",
- "how-to-guides/query-builder/call-procedures",
- "how-to-guides/query-builder/delete-remove-objects",
- "how-to-guides/query-builder/set-or-update-objects",
- ],
+ id: "how-to-guides/query-builder",
},
{
type: "category",