put
Encapsulates commands that put key/value pairs to the store or put rows to a table. The subcommands are as follows:
put kv
put kv -key <keyString> -value <valueString> [-file]
[-hex] [-if-absent] [-if-present] Put the specified key/value pair into the store. The following arguments apply to the put command:
-
-key<keyString>Specifies the name of the key to be put into the store. Key can be composed of both major and minor key paths, or a major key path only. The <keyString> format is: "major-key-path/-/minor-key-path".
For example, a key containing major and minor key paths:
kv-> put kv -key /Smith/Bob/-/email -value "{\"id\": 1,\"email\":\"bob.smith@example.com\"}"For example, a key containing only a major key path:
kv-> put kv -key /Smith/Bob -value"{\"name\": \"bob.smith\", \"age\": 20, \"phone\":\"408 555 5555\", \"email\": \"bob.smith@example.com\"}" -
-value <valueString>If -file is not specified, the <valueString> is treated as a raw bytes array.
For example:
kv-> put kv -key /Smith/Bob/-/phonenumber -value "408 555 5555"Note:
The mapping of the raw arrays to data structures (serialization and deserialization) is left entirely to the application.
-
-fileIndicates that the value is obtained from a file. The file to use is identified by the value parameter.
For example:
kv-> put kv -key /Smith/Bob -value ./smith-bob-info.txt -file -
-hexIndicates that the value is a BinHex encoded byte value with base64 encoding.
-
-if-absentIndicates that a key/value pair is
putonly if no value for the given key is present. -
-if-presentIndicates that a key/value pair is
putonly if a value for the given key is present.
put table
kv-> put table -name table_name [if-absent | -if-present ]
[-json string] [-file file_name] [-exact] [-update] Puts one or more rows into the named table.
-nameSpecifies a table name, which can identify different types of tables:
table_name– The table is a top level table created in the default namespace,sysdefault. The defaultsysdefault:namespace prefix is not required.table_name.child_name– The table is a child table. Always precede achild_nametable with its parenttable_name, followed by a period (.) separator.namespace_name:table_name– The table was created in the namespace you specify. Always precedetable_namewith itsnamespace_name, followed by a colon (:).namespace_name:table_name.child_name– The table is a child table of a parent table created in a namespace. Specifychild_nameby preceding it with bothnamespace_name:and its parenttable_name, , followed by a period (.) separator.
-
-if-absentIndicates to put a row only if the row does not exist.
-
-if-presentIndicates to put a row only if the row already exists.
-
-jsonIndicates that the value is a JSON string.
-
-fileUse to load a file of JSON strings.
-
-exactIndicates that the input JSON string or file must contain values for all columns in the table and cannot contain extraneous fields.
-
-updateCan be used to partially update the existing record.