Defining Fields in a NoSQL Database
In the Write to NoSQL DB stage, the Fields tab defines the names and types of fields fetched from the previous stage.
-
On the Fields Tab, click
Regenerate.
This displays the fields that are flowing from the previous stage.
The data is displayed in the following format: Fieldname(datatype).Note: For Couchbase, if the record has an _id field, this field will be used as a key for writing the record into the database. Else, the key for the record, will be autogenerated and written to the database. - To modify the name and type of a field, highlight the field, and click Modify.
- In the Name field, choose the field you want to add or type the name of the field.
-
In the Type field, you can leave the data type as string
if you do not intend to perform any mathematical operations with the data.
However, if you intend to perform these kinds of operations, select an
appropriate data type. This will convert the string data from the file to a data
type that will enable the proper manipulation of the data in the dataflow.
The stage supports the following data types:
- double
- A numeric data type that contains both negative and positive double precision numbers between 2-1074 and (2-2-52)×21023. In E notation, the range of values is -1.79769313486232E+308 to 1.79769313486232E+308.
- float
- A numeric data type that contains both negative and positive single precision numbers between 2-149 and (2-223)×2127. In E notation, the range of values -3.402823E+38 to 3.402823E+38.
- integer
- A numeric data type that contains both negative and positive whole numbers between -231 (-2,147,483,648) and 231-1 (2,147,483,647).
- long
- A numeric data type that contains both negative and positive whole numbers between -263 (-9,223,372,036,854,775,808) and 263-1 (9,223,372,036,854,775,807).
- string
- A sequence of characters.
- From the Fields tab, you can either individually select each field to be written to the database or click Select All to select all the fields.
- Optional: From the Runtime tab, you can set the batch size. The batch size denotes the number of records that are to be written to the database at one time.
- Click OK.