dbshell replace

Description

The dbshell replace command replaces a document in a JSON table. You can specify a condition with the command.

Parameters

replace Options Description

*, --t, --table

(Required)

Table path

--id

(Required)

ID of the document to replace

If the specified ID does not exist, the command inserts a new document with the values provided in the command.

NOTE You can specify this parameter only once.

--v, --value

(Required)

JSON document to insert or replace
--c, --where

OJAI condition, in JSON format

The condition must qualify to perform the replace. See OJAI Query Condition Syntax for a description of the syntax.

Syntax

replace /tbl --id <id> --v {<document to replace>} [--c <condition>]

Example

replace /tables/users --id user002 --value '{"first_name":"Jane", "last_name":"Doe"}'