SortAttributes Property
A string of attribute names to sort on with optional relative matching rules.
Syntax
ldap.getSortAttributes([callback]) ldap.setSortAttributes( sortAttributes, [callback])
Default Value
""
Callback
The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).
The callback for the getSortAttributes([callback]) method is defined as:
function(err, data){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'data' is the value returned by the method.
The callback for the setSortAttributes([callback]) method is defined as:
function(err){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'err' has 2 properties which hold detailed information:
err.code err.message
Remarks
This property contains a string of attribute names to sort on with optional relative matching rules. When set prior to a Search, entries returned by the server will be sorted according to SortAttributes. The format consists of one or more attribute names separated by spaces. Each attribute may be followed by an optional matching rule.
If matching rules are defined, they should be separated from the attribute names with a "/".
Normally the values are returned in ascending order. If descending (reverse) order of sorting is desired, the attribute type must be preceded with a "-".
Examples:
LDAPControl.SortAttributes = "loginTime" LDAPControl.SortAttributes = "name/caseIgnoreSubstringsMatch age/numericStringSubstringsMatch" LDAPControl.SortAttributes = "cn age/1.3.6.1.4.1.1466.115.121.1.27" LDAPControl.SortAttributes = "-cn age/1.3.6.1.4.1.1466.115.121.1.27"Matching Rules for Equality Filters
1.3.6.1.4.1.1466.115.121.1.38 | objectIdentifierMatch |
1.3.6.1.4.1.1466.115.121.1.12 | distinguishedNameMatch |
1.3.6.1.4.1.1466.115.121.1.15 | caseIgnoreMatch |
1.3.6.1.4.1.1466.115.121.1.36 | numericStringMatch |
1.3.6.1.4.1.1466.115.121.1.41 | caseIgnoreListMatch |
1.3.6.1.4.1.1466.115.121.1.27 | integerMatch |
1.3.6.1.4.1.1466.115.121.1.6 | bitStringMatch |
1.3.6.1.4.1.1466.115.121.1.50 | telephoneNumberMatch |
1.3.6.1.4.1.1466.115.121.1.43 | presentationAddressMatch |
1.3.6.1.4.1.1466.115.121.1.34 | uniqueMemberMatch |
1.3.6.1.4.1.1466.115.121.1.42 | protocolInformationMatch |
1.3.6.1.4.1.1466.115.121.1.24 | generalizedTimeMatch |
1.3.6.1.4.1.1466.115.121.1.26 | caseExactIA5Match |
1.3.6.1.4.1.1466.115.121.1.26 | caseIgnoreIA5Match |
1.3.6.1.4.1.1466.115.121.1.24 | generalizedTimeOrderingMatch |
1.3.6.1.4.1.1466.115.121.1.15 | caseIgnoreOrderingMatch |
1.3.6.1.4.1.1466.115.121.1.58 | caseIgnoreSubstringsMatch |
1.3.6.1.4.1.1466.115.121.1.58 | telephoneNumberSubstringsMatch |
1.3.6.1.4.1.1466.115.121.1.58 | numericStringSubstringsMatch |
1.3.6.1.4.1.1466.115.121.1.27 | integerFirstComponentMatch |
1.3.6.1.4.1.1466.115.121.1.38 | objectIdentifierFirstComponentMatch |
Data Type
String