让孩子们只要父母在LDAP相匹配?孩子们、相匹配、父母、LDAP

2023-09-08 12:27:15 作者:撩情只剩一身傲

我正在做一个大的LDAP查询。我想获得一堆条目,我们姑且称之为项目,我想每个项目的子项,以及(但只有当项目匹配)。

I'm making a big LDAP query. I want to get a bunch of entries, let's call them Items, and I want to get each Item's SubItem as well (but only if Item matches).

例如,假设 MyItem 有一个字段 BirthdayToday ,其值,并有一千个其他项目,但是他们对于该字段值为。每一个项目, MyItem 在内,有一个子项。

For example, let's say MyItem has a field BirthdayToday, and its value is True, and there are a thousand other Items, but their value for that field is False. Every Item, MyItem included, has a SubItem.

我今天要获得每个项目的生日,连同其子项。所以,我的结果应该返回 MyItem 及其子项,我们将称之为 MySubItem

I want to get every Item with a birthday today, along with its SubItem. So my result should return MyItem and its SubItem, we'll call it MySubItem.

我想不出一个好办法做到这一点在一个查询中,因为LDAP是不是非常有活力。我能做到这一点的两个查询,如果LDAP将让我检查的distinguishedName 字段,但它不,它只是让我看看它的值是present。

I cannot think of a good way to do this in one query, since LDAP isn't very dynamic. I could do this in two queries if LDAP would allow me to check the distinguishedName field, but it doesn't, it only allows me to see if it the value is present.

例如,这个作品:的distinguishedName = * 但这并不:的distinguishedName = *字*

Eg, this works: distinguishedName=* but this doesn't: distinguishedName=*word*.

任何人都知道如何做到这一点?

Anyone know of how this is done?

推荐答案

您不能在一个LDAP搜索做到这一点。你将不得不寻找匹配的父项,然后列出他们的子环境,或搜索他们。

You can't do this in one LDAP search. You would have to search for the parent items that match, and then list their subcontexts, or search them.