We look at a possible answer to Tutorial 3's challenge. This shows how to write a query which fetches all WebApp items, not Module items.
The trick here was to examine the model_schema_names and spot the common patterns in their values.
The two types of models we wanted had these model_schema_names beginning with "webapp_":
The types of models we don't want have model_schema_name values without "webapp_", for example:
So, in order to filter for the models we do want and not the models we don't want, we need models which start with the string webapp_. Code:
Notes:
Explorer:
This is just one possible answer, you may have found a different method.
Try and make sure you choose the best method for your use case. You should always be looking out for a more efficient way of doing things.
We'll continue to look at filtering queries in more detail, including:
Let's go!