Skip to content

Commit

Permalink
Update graph-operators.md
Browse files Browse the repository at this point in the history
add more context in operator page
  • Loading branch information
mirnawong1 authored Jan 8, 2025
1 parent 2e5736d commit 195a143
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions website/docs/reference/node-selection/graph-operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ title: "Graph operators"
---

### The "plus" operator
If placed at the front of the model selector, `+` will select all ancestors of the selected model and the model itself. If placed at the end of the string, `+` will select all descendants of the selected model and the model itself.
The `+` operator expands your selection to include ancestors (upstream dependencies) or descendants (downstream dependencies) of a resource. This operator works for individual models, tags, or other resources.

- `+` operator placed after a model/resource — Includes the resource itself and all its descendants (downstream dependencies).
- `+` operator placed before a model/resource — Includes the resource itself and all its ancestors (upstream dependencies).
- `+` operator placed on both sides of a model/resource — Includes the resource itself, all its ancestors, and all its descendants.

```bash
```bash
dbt run --select "my_model+" # select my_model and all descendants
dbt run --select "+my_model" # select my_model and all ancestors
dbt run --select "+my_model+" # select my_model, and all of its ancestors and descendants
```
```

You can use it with selectors for a more specific scope in your commands. You can also combine it with [`--exclude`](/reference/node-selection/exclude) for even more finer control over what gets included in your command.

### The "n-plus" operator

Expand Down

0 comments on commit 195a143

Please sign in to comment.