@@ -39,3 +39,46 @@ func ExampleRequest_all() {
3939 log .Fatal (err )
4040 }
4141}
42+
43+ // AddField lets you limit requests to certain fields, this can speed them up significanty.
44+ func ExampleRequest_AddField () {
45+ NewRequest ("https://test.com/api/" , "person" , "pers_123" ).
46+ AddField (NewField ("first_name" )).
47+ AddField (NewField ("last_name" ))
48+ }
49+
50+ func ExampleRequest_Expand () {
51+ NewRequest ("https://test.com/api/" , "person" , "pers_123" ).
52+ Expand (NewField ("team_url" ))
53+ }
54+
55+ func ExampleRequest_OrderBy () {
56+ NewRequest ("https://test.com/api/" , "person" , "" ).
57+ OrderBy (NewField ("first_name" ))
58+ }
59+
60+ // Filters are helpful to search for onjects with knowing their ID
61+ func ExampleRequest_WithFilter () {
62+ NewRequest ("https://test.com/api/" , "person" , "" ).
63+ WithFilter ("first_name" , NewFilter (Equals , "Bob" ))
64+ }
65+
66+ func ExampleRequest_WithFilter_greater_than () {
67+ NewRequest ("https://test.com/api/" , "person" , "" ).
68+ WithFilter ("salary" , NewFilter (GreaterThan , "10000" ))
69+ }
70+
71+ // You can use comma separated lists to query multiple objects at once.
72+ func ExampleRequest_WithFilter_multiple () {
73+ NewRequest ("https://test.com/api/" , "person" , "" ).
74+ WithFilter ("first_name" , NewFilter (Equals , "Bob,Lucas,Sue" ))
75+ }
76+
77+ func ExampleField_WithSubField () {
78+ NewRequest ("https://test.com/api/" , "person" , "" ).
79+ AddField (NewField ("first_name" )).
80+ AddField (NewField ("team_url" ).
81+ WithSubField (NewField ("name" )).
82+ WithSubField (NewField ("nation_url" ).
83+ WithSubField (NewField ("name" ))))
84+ }
0 commit comments