Delete index

Purpose: Delete a node from an index.

 delete-index <index> key <key> \
     [ status <status> ] \
     [ value <value> ] \

delete-index will search <index> for string <key> and if found, delete its node (including the key in it), set <value> (in "value" clause) to node's value, and set <status> number (in "status" clause) to GG_OKAY. If <key> is not found, <status> will be GG_ERR_EXIST. If <status> is not GG_OKAY, <value> is unchanged.
Examples
Delete node with key "123", and obtain its value:
 set-string k = "123"
 delete-index myindex key k value val status st
 if-true st not-equal GG_OKAY
    @Could not find key <<p-out k>>
    exit-handler
 end-if
 // display key/value deleted
 @Deleted key <<p-out k>> with value <<p-out val>>
 // delete the original value
 delete-string val

See also
Index
delete-index  
get-index  
new-index  
purge-index  
read-index  
use-cursor  
write-index  
See all
documentation


Copyright (c) 2019-2024 Gliim LLC. All contents on this web site is "AS IS" without warranties or guarantees of any kind.