I am new to orientDB. I want to know how to insert json values from json file into orientDB.
{ "config": {
"log": "debug" }, "source" : {
"file": { "path": "D:\\New folder\\database.json" } }, "extractor" : {
"json": {} }, "transformers" : [
{ "merge": { "joinFieldName": "id", "lookup": "Account.id" } },
{ "vertex": { "class": "Account"} },
{ "edge": {
"class": "Friend",
"joinFieldName": "friends",
"lookup": "Account.id",
"unresolvedLinkAction": "CREATE"
} },
{ "edge": {
"class": "Enemy",
"joinFieldName": "enemies",
"lookup": "Account.id",
"unresolvedLinkAction": "CREATE"
} } ], "loader" : {
"orientdb": {
"dbURL": "D:\\InstalledSoftwares\\orientdb-3.0.8\\databases\\demodb",
"dbUser": "root",
"dbPassword": "vtg@123",
"dbAutoDropIfExists": true,
"dbAutoCreate": true,
"standardElementConstraints": false,
"tx": false,
"wal": false,
"batchCommit": 1000,
"dbType": "graph",
"classes": [{"name": "Account", "extends":"V"}, {"name": "Friend", "extends":"E"}, {"name": 'Enemy', "extends":"E"}],
"indexes": [{"class":"Account", "fields":["id:integer"], "type":"UNIQUE_HASH_INDEX" }]
} } }
this is the code i am using to insert json values from json file. If i run this code means it throws an error like
java.lang.IllegalArgumentException: text cannot be null
Can you plz verify this and help me to fix this. Thanks in Advance
I tried your case and it worked
database.json
import.json
then I ran oetl.bat import.json and this is what I get:
Hope it helps
Regards