7.use of logical operators
i.) NOT
https://*******devaos.cloudax.dynamics.com/data/Beaconservice?$filter=not(BeaconNum eq '123456789')
OR
https://********devaos.cloudax.dynamics.com/data/Beaconservice?$filter=BeaconNum ne '123456789'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
| { "@odata.context": "https://********devaos.cloudax.dynamics.com/data/$metadata#Beaconservice", "value": [ { "@odata.etag": "W/\"Jzg0ODAyMzczOCw1NjM3MTQ0NTc3Jw==\"", "Description": "Beacon 2", "dataAreaId": "usrt", "BeaconNum": "234567891", "EffectiveDate": "2017-01-08T12:00:00Z", "BeaconStatus": "InActive", "Brand": "Brand2", "StartTime": 0, "Category": "Category2", "EndTime": 0, "Offer": "", "OfferId": "offer2" }, { "@odata.etag": "W/\"JzEsNTYzNzE0NDU3OCc=\"", "Description": "Beacon 3", "dataAreaId": "usrt", "BeaconNum": "345678912", "EffectiveDate": "2017-05-08T12:00:00Z", "BeaconStatus": "Active", "Brand": "Brand3", "StartTime": 0, "Category": "Category3", "EndTime": 0, "Offer": "", "OfferId": "Offer3" } ] } |
ii.) CONTAINS(*)
https://*********devaos.cloudax.dynamics.com/data/Beaconservice?$filter=BeaconNum eq '*9'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| { "@odata.context": "https://**********devaos.cloudax.dynamics.com/data/$metadata#Beaconservice", "value": [ { "@odata.etag": "W/\"JzE0NTk5MjkxNjcsNTYzNzE0NDU3Nic=\"", "Description": "beacon 1", "dataAreaId": "usrt", "BeaconNum": "123456789", "EffectiveDate": "2017-01-08T12:00:00Z", "BeaconStatus": "Active", "Brand": "Brand1", "StartTime": 0, "Category": "Category1", "EndTime": 0, "Offer": "", "OfferId": "Offer1" } ] } |
iii.) AND
https://********devaos.cloudax.dynamics.com/data/Beaconservice?$filter=BeaconNum eq '345678912' and OfferId eq 'Offer3'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| { "@odata.context": "https://*******devaos.cloudax.dynamics.com/data/$metadata#Beaconservice", "value": [ { "@odata.etag": "W/\"JzEsNTYzNzE0NDU3OCc=\"", "Description": "Beacon 3", "dataAreaId": "usrt", "BeaconNum": "345678912", "EffectiveDate": "2017-05-08T12:00:00Z", "BeaconStatus": "Active", "Brand": "Brand3", "StartTime": 0, "Category": "Category3", "EndTime": 0, "Offer": "", "OfferId": "Offer3" } ] } |
iv.) OR
https://*********devaos.cloudax.dynamics.com/data/Beaconservice?$filter=BeaconNum eq '345678912' or BeaconNum eq '123456789'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
| { "@odata.context": "https://********devaos.cloudax.dynamics.com/data/$metadata#Beaconservice", "value": [ { "@odata.etag": "W/\"JzE0NTk5MjkxNjcsNTYzNzE0NDU3Nic=\"", "Description": "beacon 1", "dataAreaId": "usrt", "BeaconNum": "123456789", "EffectiveDate": "2017-01-08T12:00:00Z", "BeaconStatus": "Active", "Brand": "Brand1", "StartTime": 0, "Category": "Category1", "EndTime": 0, "Offer": "", "OfferId": "Offer1" }, { "@odata.etag": "W/\"JzEsNTYzNzE0NDU3OCc=\"", "Description": "Beacon 3", "dataAreaId": "usrt", "BeaconNum": "345678912", "EffectiveDate": "2017-05-08T12:00:00Z", "BeaconStatus": "Active", "Brand": "Brand3", "StartTime": 0, "Category": "Category3", "EndTime": 0, "Offer": "", "OfferId": "Offer3" } ] } |
Other than the operators explained, below mentioned logical operators can be used in a same manner.
v.)Greater Than(gt)
vi.)Greater Than or Equal(ge)
vii.)Less Than(lt)
viii.)Less Than or Equal(le)
There are some arithmetic operators that can be used on integer/real type fields to produce result.
xi.) ADDITION (add)
x.)SUBTRACTION (sub)
xi.)MULTIPLICATION (mul)
xii.)DIVISION (div)
Then there is one more operator that has to be used extensively.
AMPERSAND(&)
There might be situations when you need to use previously explained query operators(filter, select, etc..) together to produce relevant set of data.
https://**********devaos.cloudax.dynamics.com/data/Beaconservice?$filter=BeaconNum eq '345678912' &$select=BeaconNum,Description,OfferId
1
2
3
4
5
6
7
8
9
10
11
| { "@odata.context": "https://*********devaos.cloudax.dynamics.com/data/$metadata#Beaconservice(BeaconNum,Description,OfferId)", "value": [ { "@odata.etag": "W/\"JzEsNTYzNzE0NDU3OCc=\"", "BeaconNum": "345678912", "Description": "Beacon 3", "OfferId": "Offer3" } ] } |
Tidak ada komentar:
Posting Komentar