Skip to content

Griddb node api #8

Description

@victortosin02

I am currently working on a Griddb project using NodeJS and I keep encountering this error. Can someonegive an insight into what is going on and what could be done?

Error: GSException {
mCode: -1,
mMessage: 'Error with number 140000',
mLocation: '',
mStackSize: 5
}

// Insert data into GridDB
async function insertIntoGridDB(data) {
const factory = griddb.StoreFactory.getInstance();
const store = factory.getStore({
"notificationMember": "172.24.0.2:10001",
"clusterName": "myCluster",
"username": "admin",
"password": "admin"
});

const containerName = 'occupation_stats';
const containerInfo = new griddb.ContainerInfo({
    name: containerName,
    columnInfoList: [
        ["occupation", griddb.Type.STRING],
        ["minIncome", griddb.Type.LONG],
        ["maxIncome", griddb.Type.LONG],
        ["minFamilySize", griddb.Type.LONG],
        ["maxFamilySize", griddb.Type.LONG]
    ],
    type: griddb.ContainerType.COLLECTION,
    rowKey: true
});

const container = await store.putContainer(containerInfo);
await container.createIndex({
    'columnName': 'occupation',
    'indexType': griddb.IndexType.DEFAULT
});

const rows = [];
for (const [occupation, stats] of Object.entries(data)) {
    rows.push([
        occupation,
        stats.minIncome,
        stats.maxIncome,
        stats.minFamilySize,
        stats.maxFamilySize
    ]);
}

await container.multiPut(rows);

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions