how to save data in aws neptune db using node js?

前端 未结 2 1689
[愿得一人]
[愿得一人] 2021-01-23 09:38

Is there a way to save the data in amazon aws neptune db using node js? I am running this code on a lambda.

I made the connection to neptune db using the below code.

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-23 10:22

    Simple demo based off the TinkerPop documentation

    const handler = async (event) => {
        // add person vertex with a property name and value stephen.
        await g.addV('person').property('name','stephen').next();
    
        // fetch all vertex' and get the name properties.
        const result = await g.V().values('name').toList();
        console.log(result);
    
        return {
            statusCode: 201,
            body: JSON.stringify({message:"Testing Gremlin!", data:result}),
        };
    }
    

提交回复
热议问题