Symisc Vedis

An Embeddable Datastore Engine

Vedis Built-in Commands - Key/Value.


SETNX key value


Set key to hold string value if key does not exist. In that case, it is equal to SET.  When key already holds a value, no operation is performed. SETNX is short for  "SET if N ot e X ists".

Return value

Boolean: True on success. False otherwise.


Refer to the download page for some C/C++ samples on how to invoke this command from your host application.

vedis> SETNX test "Hello"
vedis> SETNX message "Greeting!"

vedis> SETNX message "Bye Bye"

vedis> MGET test message
(1) Hello
(2) Greeting!

Symisc Systems
Copyright © Symisc Systems