[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: deleting values from multivalued attribute
- To: openldap-technical@openldap.org
- Subject: Re: deleting values from multivalued attribute
- From: Emmanuel Lecharny <elecharny@gmail.com>
- Date: Fri, 25 Mar 2011 17:00:44 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:reply-to:user-agent :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=t76bv1+KwKfyvwpk4o/HKzNz7aiFK5HZOV8F8BEs/3A=; b=ZrrPQy2t+PoPRyPlLJu47dHrPRSLRRi7IV8eM8pWihr+GpS4KNYd7hhZIa9ci69LA0 JR/k5Kgb8wpkVZcA7FFIyBnRB1Sa4QSWe6TNqKw9zZ+kKAVriV3Au+XfZ1EhDh5VBugU m0hpGP9bTQPJx1xY7ssqmr17USZwgrT4Qsq4M=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; b=SkSo08dEt6hy0vxcJteditm6lIpEAnS6x/2vzoBtPDM821xh9dCR9ojzNRRHdYKrJA JJB7L3C9qwzs37vEkudFBigyxpgM5LLz3YWVhJKN2ZJapom6HRY/1Mfx8is2pZxdzKq4 kEq3NoclI7eP9AgvsI1eZogoo5rkUD3yj3xzk=
- In-reply-to: <4D8CB86B.2010900@fct.unl.pt>
- References: <4D8CAC01.1060107@fct.unl.pt> <4D8CAE18.70708@gmail.com> <4D8CB86B.2010900@fct.unl.pt>
- User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7
On 3/25/11 4:44 PM, Hugo Monteiro wrote:
On 03/25/2011 03:00 PM, Emmanuel Lecharny wrote:
On 3/25/11 3:51 PM, Hugo Monteiro wrote:
Hello list,
is it possible to perform the deletion of only a certain number of
values, from a multivalued attribute, without having to perform full
deletion and then adding the ones we'd like to keep?
Of course.
http://download.oracle.com/docs/cd/E19316-01/820-2763/bcacx/index.html
(and this is just one example. See "Deleting an Attribute Value")
Hello Emmanuel, et al,
Indeed. I was using the ldapmodify man page as reference and it
doesn't mention the option of providing the value we wish to delete.
I wonder if it's also possible to use the same approach but for value
modification. In brief evaluation, my guess is no, since the ldif
syntax doesn't provide any way to distinct between the value to be
replaced and the one to replace with.
I don't understand your question. The 'modify' operation applied on an
AT allows you to do whatever you want, assuming you give it the right
operation to apply. 'replace' will discard all the values and replace
them by the new values. Otherwise, 'delete' deletes some specific
values, and 'add' adds the ones you provide.
Isn't it enough ?
In this case one would possibly have something like
uid=user,ou=users,dc=example,dc=com
changetype: modify
replace: mailAlternateAddress
mailAlternateAddress: oldmail@example.com
mailAlternateAddress: newmail@example.com
-
But like i said, it doesn't make much sense.
It does. What the ldif snippet you gave just do is to replace all
'mailAlternateAddress' values by the two values you provided. Isn't it
what you wanted to do ?
Otherwise, assuming you want to replace the oldmail@ value by the
newmail@ value, the correct ldif would be :
uid=user,ou=users,dc=example,dc=com
changetype: modify
delete: mailAlternateAddress
mailAlternateAddress: oldmail@example.com
-
add: mailAlternateAddress
mailAlternateAddress: newmail@example.com
-
Check the LDIF RFC (http://www.ietf.org/rfc/rfc2849.txt), you have clear
samples at the end.
--
Regards,
Cordialement,
Emmanuel LÃcharny
www.iktek.com