Hi All,
i'm use the OrientDb batch rest api to interact with my OrientDB database. 
Now i have a specific need.

i want create a vertex only if this vertex not exists.

Then i write this lines of code with the IF condition but the statement in 
the if condition is never executed. How is possible test if the root_node 
not exist and then create it? This is my postData code

    var postData = JSON.stringify({ "transaction" : true,
        "operations" : [
            {
              "type" : "script",
              "language" : "sql",
              "script" : [ 
                   "LET root_node = SELECT FROM PowerSolution WHERE 
Site_User ='" + message.Site_User + "' AND uuid = '"+ message.StartTime + 
"'",
                   "IF($root_node IS NULL){",
               "LET new_root_node = CREATE VERTEX PowerSolution SET 
Site_User ='" + message.Site_User + "', uuid = '"+ message.StartTime + "'",
               "}"
               ]
            }
        ]
    });
Also with $root_node == NULL condition the result don't change
Any suggestion will be appreciated.

Thanks in advance.
Best regards and happy new year
    Leo

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to