Editing a Schema

You can modify an existing schema stored in a Couchbase database or in a JSON file.

You provide the configuration information to the connector in the connection URL. For more information about the syntax of the connection URL, see Building the Connection URL.

To edit a schema saved in a database:

  1. To export the schema from the database to a local JSON file that you can edit, set the connection properties as follows and then connect to the database:
    • Set the SchemaMapOperation property to 3.
    • Set the LocalSchemaFile property to the full path of a JSON file that you want to use to locally store the schema.

    When you connect to the database, the connector exports the schema from the database to the JSON file.

    Important:

    The exported schema replaces all existing content in the JSON file.

  2. Open the JSON file in the Schema Editor, modify the schema as needed, and then save your changes. For more information about using the Schema Editor, see the Schema Editor User Guide.
  3. To import the modified schema into the database, set the connection properties as follows and then reconnect to the database:
    • Set the SchemaMapOperation property to 2.
    • Set the LocalSchemaFile property to the full path of the JSON file.

    When you connect to the database, the connector imports your modified schema into the database and copies it to every bucket.

    Important:

    The schema that you import overwrites the existing schema in the database.

To edit a schema saved in a JSON file:

  • Open the JSON file in the Schema Editor, modify the schema as needed, and then save your changes. For more information about using the Schema Editor, see the Schema Editor User Guide.