The "plus" operator
If placed at the front of the model selector,
+ will select all parents of the selected model. If placed at the end of the string,
+ will select all children of the selected model.
$ dbt run --select my_model+ # select my_model and all children
$ dbt run --select +my_model # select my_model and all parents
$ dbt run --select +my_model+ # select my_model, and all of its parents and children
The "n-plus" operator
You can adjust the behavior of the
+ operator by quantifying the number of edges
to step through.
$ dbt run --select my_model+1 # select my_model and its first-degree children
$ dbt run --select 2+my_model # select my_model, its first-degree parents, and its second-degree parents ("grandparents")
$ dbt run --select 3+my_model+4 # select my_model, its parents up to the 3rd degree, and its children down to the 4th degree
The "at" operator
@ operator is similar to
+, but will also include the parents of the children of the selected model. This is useful in continuous integration environments where you want to build a model and all of its children, but the parents of those children might not exist in the database yet. The selector
@snowplow_web_page_context will build all three models shown in the diagram below.
$ dbt run --models @my_model # select my_model, its children, and the parents of its children
The "star" operator
* operator matches all models within a package or directory.
$ dbt run --select snowplow.* # run all of the models in the snowplow package
$ dbt run --select finance.base.* # run all of the models in models/finance/base