Hello in this video, I will continue talking about how you can filter the data returned from rest web service. Last video I'll show you how you can return a number of fruits and which offset or the batch number you want to return. In this video, I will show you how you can add some condition some query to return some specific data. For example, here if I if I want to return department name marketing for Tom for example, so you can write here as a question mark Q equal to Bart men name equal marketing, it will be something like this. If you want to add for example, or the or equals something else so we can right here space or seats Or equal seats like this. So it will return marketing and sales.
You can use greater than or less than for example if you want to department or Ed listen lesson 100 so it will return all department ID which is less than 100 you can add more condition like if you want to get the bottom into the list and this 100 but you can order boy for example location ID so you can add here order boy equal in location ID so it will return order by location id 41. As you can see, it is ordered by location already. So if you want to make any order after any operation, just add order by equal and enter the attribute name what you want to make an order by. For example, if you want to add two more conditions, for example, if you need all departments less than 100 and look at location ID for example 1700 so how you can do this?
You can surround this first condition by brackets and right at add another brackets for the second condition Q equal to location ID equal 1700. Okay, so a Twitter turn. Oh, it looks not working. So let's cue equal department ID Zen. One and it is Moses yes it should be like this. So, it will return all combination.
So, the fridge just condition two brackets and the other one the last one no brackets, so you will find here it returned a document is this 700 and location equal 1700 it won't add order by by and you can add order by there is something goods like like if you want for example, Q equal you Bart meant name equal seats okay so two sentences you call it all equal marketing it will Return or equal it means if you use the same attribute you choose you are using. So, department equals seeds or equal marketing. So, it will return the both or you can use like for example, I need the word meant equal sales or like admin and like store like this should it means, department name equals ears or start with admin. If you receive you will find a good administration because start with admin and sales, but be sure to like should be in a capital because if you write it in small letters, it will not take into the consideration it will return only the sales and this is ignore.
So you have right here to be sure that like is capital in capital letters. So you add can add condition as you can see you can add or you can use like you can use equal, you can add to condition like the workmen name equals sales and location equal something else, you can make order boy. I think this is the most operation you can use to get specific data. So, from the next video we will start to create our custom method and expose it as a result. So, see you next activity