- A realistic example would read
- GetNodes ( { 'node_type' : 'regular' , 'hostname' : '*.edu' , '-SORT' : 'hostname' , '-OFFSET' : 30 , '-LIMIT' : 25 } )
- and that would return regular (usual) nodes matching '*.edu' in alphabetical order from 31th to 55th
+ * similarly the two special keys below allow to change the semantics of multi-keys filters
+ * '-AND' : select rows that match ALL the criteria (default)
+ * '-OR' : select rows that match ANY criteria
+ The value attached to these keys is ignored.
+ Please note however that because a Filter is a dict, you cannot provide two criteria on a given key.
+
+
+ Here are a few realistic examples
+
+ GetNodes ( { 'node_type' : 'regular' , 'hostname' : '*.edu' ,
+ '-SORT' : 'hostname' , '-OFFSET' : 30 , '-LIMIT' : 25 } )
+ would return regular (usual) nodes matching '*.edu' in alphabetical order from 31th to 55th
+
+ GetNodes ( { '~peer_id' : None } )
+ returns the foreign nodes - that have an integer peer_id
+
+ GetPersons ( { '|role_ids' : [ 20 , 40] } )
+ would return all persons that have either pi (20) or tech (40) roles
+
+ GetPersons ( { '&role_ids' : 10 } )
+ GetPersons ( { '&role_ids' : 10 } )
+ GetPersons ( { '|role_ids' : [ 10 ] } )
+ GetPersons ( { '|role_ids' : [ 10 ] } )
+ all 4 forms are equivalent and would return all admin users in the system