// Copyright Abridged, Inc. 2023,2024. All Rights Reserved. // Node module: @collabland/aws // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT import {isMain} from '@collabland/common'; import {OpenSearchServiceClient} from '../index.js'; async function main() { const client = new OpenSearchServiceClient({ index: 'collabland-test', }); await client.init(); const res = await client.indexDocument( { x: 1, y: 2, name: 'collabland-test', body: { communityId: 'DIS#COMM#1', userId: 'DIS#USER#2', body: { a: 'a', b: 'B', }, other: { c: 'a', d: 'B', }, }, }, { index: 'collabland-test-flattened-3', indexConfig: { mappings: { dynamic_templates: [ { body_body: { match_mapping_type: 'object', path_match: 'body.body', mapping: { type: 'object', enabled: false, }, }, }, ], }, }, }, ); console.log(res); await client.stop(); } if (isMain(import.meta.url)) { await main(); }