IBM Seedlist Connector 25.1
IBM Seedlist Connector Help

# LuaJsonObject:new

The constructor for a `LuaJsonObject` object (creates a new `LuaJsonObject`).

If you do not specify any attributes to assign to the object (by omitting the `attributes` argument), an empty object is created.

## Syntax

    LuaJsonObject:new( [attributes] )

## Arguments

Argument | Description
--- | ---
`attributes` | (lua_json_object_type) A table of attributes (name/value pairs) to assign to the object. The keys in the table must be strings which specify the names of the attributes. Each value can be a Boolean, float, integer, string, LuaJsonObject, LuaJsonArray, LuaJsonValue, or nil. TIP: In Lua, keys in a table cannot be assigned the value of `nil`. If you want to have a null value (`nil` in Lua), you can do the following: `LuaJsonObject:new( { key=LuaJsonValue:new(nil) } )`.

## Returns

(LuaJsonObject). The new `LuaJsonObject` object.

## Example

The following is a simple JSON object:

    {"product":"IDOL","version":11}

To create a `LuaJsonObject` object to represent this JSON object:

    local myJsonObject = LuaJsonObject:new( { product="IDOL" , version=11 } )

Copyright 2024 Open Text
Version 25.1 | Last updated January 2025

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: Knowledge Discovery IBM Seedlist Connector 25.1

Topic Title: LuaJsonObject:new