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?
example, entry has:
mail: user@example.com mailAlternateAddress: first.last@example.com mailAlternateAddress: flast@example.com mailAlternateAddress: firstl@example.com
I would like to be able to remove flast@example.com but keep the rest of the addresses, using a single ldap operation, ending up with
mail: user@example.com mailAlternateAddress: first.last@example.com mailAlternateAddress: firstl@example.com
Best Regards,
Hugo Monteiro.
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")
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.
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.
Can someone enlighten me?
Best Regards,
Hugo Monteiro.
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.
On 03/25/2011 04:00 PM, Emmanuel Lecharny wrote:
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 ?
Aye, i understand it can be done through delete/add. My wondering was about the possibility to perform the change using a single operation.
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
Yes, that's what was intended.
Check the LDIF RFC (http://www.ietf.org/rfc/rfc2849.txt), you have clear samples at the end.
Thanks for the pointer. I have visited the rfc before but didn't go through the end of the document.
Best Regards,
Hugo Monteiro.
On 3/25/11 5:27 PM, Hugo Monteiro wrote:
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 ?
Aye, i understand it can be done through delete/add. My wondering was about the possibility to perform the change using a single operation.
It *is* a single operation. It's the Modify operation, and it's guaranteed to be executed as an atomic operation. Everything else is pure semantic.
Hugo Monteiro wrote:
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
Yes, that's what was intended.
Note that this only works if the attribute type (here mailAlternateAddress) has an EQUALITY matching rule defined in the subschema. This is not always the case, e.g. binary attributes does not have one.
Ciao, Michael.
Hello Hugo,
my Apache Directory Studio shows me following operations:
adding an entry:
dn: cn=test,ou=Groups,dc=example,dc=com changetype: modify add: memberUid memberUid: test
removing single entry of a multi-value attribute:
dn: cn=test,ou=Groups,dc=example,dc=com changetype: modify delete: memberUid memberUid: test
bye, benjamin
On Fri, Mar 25, 2011 at 15:51, Hugo Monteiro hugo.monteiro@fct.unl.pt 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?
example, entry has:
mail: user@example.com mailAlternateAddress: first.last@example.com mailAlternateAddress: flast@example.com mailAlternateAddress: firstl@example.com
I would like to be able to remove flast@example.com but keep the rest of the addresses, using a single ldap operation, ending up with
mail: user@example.com mailAlternateAddress: first.last@example.com mailAlternateAddress: firstl@example.com
Best Regards,
Hugo Monteiro.
-- fct.unl.pt:~# cat .signature
Hugo Monteiro Email : hugo.monteiro@fct.unl.pt Telefone : +351 212948300 Ext.15307 Web : http://hmonteiro.net
Divisão de Informática Faculdade de Ciências e Tecnologia da Universidade Nova de Lisboa Quinta da Torre 2829-516 Caparica Portugal Telefone: +351 212948596 Fax: +351 212948548 www.fct.unl.pt apoio@fct.unl.pt
fct.unl.pt:~# _
openldap-technical@openldap.org