filter documentation updated

This commit is contained in:
devbysn 2023-06-28 10:47:23 +05:30
parent f2890088e4
commit 71336fca3d
1 changed files with 18 additions and 18 deletions

View File

@ -35,15 +35,15 @@ ldapjs object(s). If the filter is "complex", it will be a "tree" of objects.
For example:
```js
const parseFilter = require('ldapjs').parseFilter;
const parseFilter = require("ldapjs").parseFilter;
const f = parseFilter('(objectclass=*)');
const f = parseFilter("(objectclass=*)");
```
Is a "simple" filter, and would just return a `PresenceFilter` object. However,
```js
const f = parseFilter('(&(employeeType=manager)(l=Seattle))');
const f = parseFilter("(&(employeeType=manager)(l=Seattle))");
```
Would return an `AndFilter`, which would have a `filters` array of two
@ -112,9 +112,9 @@ map to:
```js
{
initial: 'foo',
any: ['bar', 'cat'],
final: 'dog'
subInitial: 'foo',
subAny: ['bar', 'cat'],
subFinal: 'dog'
}
```
@ -124,9 +124,9 @@ key matching `attribute` and the "regex" matches the value
```js
const f = new SubstringFilter({
attribute: 'cn',
initial: 'foo',
any: ['bar'],
final: 'baz'
subInitial: 'foo',
subAny: ['bar'],
subFinal: 'baz'
});
f.matches({cn: 'foobigbardogbaz'}); => true
@ -242,7 +242,7 @@ equality filters):
(|(cn=foo)(sn=bar))
```
The `matches()` method will return true IFF the passed in object matches *any*
The `matches()` method will return true IFF the passed in object matches _any_
of the filters in the `filters` array.
```js