Announcement Announcement Module
Collapse
No announcement yet.
How to remove one value from a multivalued attribute? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to remove one value from a multivalued attribute?

    I am using the following to add a value to a multivalued attribute. This works great:

    Code:
    DirContextAdapter context = (DirContextAdapter)ldapTemplate.lookup(groupDn);
    context.addAttributeValue("member", userDn);
    ldapTemplate.modifyAttributes(groupDn, context.getModificationItems());
    In my case I am adding, one at a time, values to the "member" attribute of a "groupOfNames" objectclass.

    My question is, how do I do the opposite of this and remove a single value from a multivalued attribute? I don't want to remove all values of the "member" attribute. I just want to remove one value and keep the rest.

    At the moment I am very stuck.

  • #2
    removeAttributeValue()?

    Comment


    • #3
      lol, stupid me... that worked, I didn't see that method on DirContextAdapter.

      Comment

      Working...
      X