英文:
Cannot retrive objectName from searchEntry when I update ldapjs to v3
问题
I recently upgraded the package ldapjs from v2 to v3. When I search for a user attribute with searchEntry
, I get an empty object, but all other functions worked without a problem, this is my code:
client.search(adSuffix, searchOptions, async (err: any, res: any) => {
assert.ifError(err);
await res.on('searchEntry', async (entry: any) => {
//
//this part was working normally with ldapjs v2
//
console.log("entry.objectName ", entry.objectName);
//but now I get an empty object
});
});
Did someone have the same issue? or know how to fix it?
英文:
I recently upgraded the package ldapjs from v2 to v3. When I search for a user attribute with searchEntry, I get an empty object, but all others functions worked without a problem, this is my code:
client.search(adSuffix, searchOptions, async (err: any, res: any) => {
assert.ifError(err);
await res.on('searchEntry', async (entry: any) => {
//
//this part was working normaly with ldapjs v2
//
console.log("entry.objectName ",entry.objectName);
//but now i get an empty object
});
});
Did someone had the same issue ? or know how to fix it ?
答案1
得分: 0
我找到了解决方案,我添加了 .pojo 以访问对象:
res.on('searchEntry', async (entry: any) => {
console.log('entry: ' + JSON.stringify(entry.pojo.objectName));
}
英文:
I found the solution, I added .pojo to access to the object:
res.on('searchEntry', async (entry: any) => {
console.log('entry: ' + JSON.stringify(entry.pojo.objectName));
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论