Construct NoSQL ItemAdmin Scope
Catalyst NoSQL items represent a collection of attributes that hold the data of a single data point, like records. You can insert or update items into an existing NoSQL table in your project in a Custom JSON format. However, before you insert or update an item in Catalyst, you will need to construct the item.
You can construct a NoSQL item of attributes containing different data types supported by Catalyst as described in the following sections. Catalyst supports several data types such as String, Number, Set of Strings, Set of Numbers, List, and Map. You must provide the values for the partition key attribute that you configured for a table in every data item.
Create a New NoSQL Item
You can create a new NoSQL item using the NoSQLItem() SDK method.
const item = new NoSQLItem(); // Create a new NoSQL item
Construct a NoSQL Item of String
In the following example code snippet, we construct an item that includes string values and a nested JSON attribute color as a Map.
const item = new NoSQLItem() // Create a new NoSQL item
// Add a string value
.addString('fruit', 'mango')
// Add a map
.addMap('properties', {
color: 'yellow'
});
Construct a NoSQL Byte
You can create a NoSQL byte to store values of the Binary data type, by creating a buffer object that is used to represent a sequence of bytes.
You can then create a byte in two ways:
- Using the ArrayBuffers object that represents a raw binary data buffer.
- Using a Base64 string that represents binary data in the ASCII format.
Example Code Snippet
const buff = Buffer.from('Hello world !!!'); // Create a buffer object
const byte = new NoSQLByte(buff); // Create a NoSQL byte using the ArrayBuffers object
const byteA = new NoSQLByte(buff.toString('base64')); // Create a NoSQL byte from a Base64 string
Construct a NoSQL Byte Set
Catalyst enables you to create a NoSQL byte set to store a collection of binary values of the Set of Binary data type, by creating a buffer object that is used to represent a sequence of bytes.
You can then create a byte set using:
- The ArrayBuffers object that represents a raw binary data buffer
- A Base64 string that represents binary data in the ASCII format.
Additionally, you can also create a byte set from passing constructed bytes as a byte array.
Example Code Snippet
const buff = Buffer.from('Hello world !!!'); // Create a buffer object
const byte = new NoSQLByte(buff); // Create a NoSQL byte using the ArrayBuffers object
const byteA = new NoSQLByte(buff.toString('base64')); // Create a NoSQL byte from a Base64 string
const byteSet = new NoSQLByteSet([byte, byteA]); // Create a NoSQL byte set from a NoSQL byte array
const byteSetA = new NoSQLByteSet([buff.toString('base64')]); // Create a NoSQL Byte set from a Base64 string array
const byteSetB = new NoSQLByteSet([buff]); // Create a NoSQL Byte set using the ArrayBuffers object
Construct a NoSQL String Set
You can create a NoSQL string set of the Set of String data type from a string array.
Example Code Snippet
const stringSet = new NoSQLStringSet(['hello', 'world']); // Create a NoSQL string set from a string array
Construct a NoSQL Number Set
You can create NoSQL number set of the Set of Numbers data type from an array of numbers or BigInt values.
Example Code Snippet
const numberSet = new NoSQLNumberSet([123, 1234n]); // Create a NoSQL Number set from an array of numbers or BigInt values
Last Updated 2026-07-02 14:51:41 +0530 IST
Yes
No
Send your feedback to us