I've read this solution before, but weirdly enough, it doesn't work on mine
(v. 2.1rc5) the rid of the object is still negative, even after the commit;
I wrote exactly the same code as you. Any ideas on why that might be?
quinta-feira, 20 de Agosto de 2015 às 19:01:57 UTC+1, Kyle escreveu:
>
> I think the problem is that in the function you are in a transaction and
> the temporary negative rid doesn't become a positive real rid until the
> transaction is committed.
>
> I tried doing:
>
> var gdb = orient.getGraph();
> var v = gdb.command( "sql", "Create Vertex set x = 'x'");
> gdb.commit()
> return v
>
> and it returned the actual rid, so that is a workaround at least.
>
> On Thursday, August 20, 2015 at 10:23:17 AM UTC-7, David de Sousa Seixas
> wrote:
>>
>> I'm stuck with the same problem.
>>
>> domingo, 15 de Fevereiro de 2015 às 03:30:04 UTC, Yong Zhong escreveu:
>>>
>>> Hi Guys I am wondering is possible to get the rid of created document on
>>> server side script created in studio
>>> var gdb = orient.getGraph();
>>> return gdb.command( "sql", "Create Vertex set x = 'x'");
>>> The response is shown
>>> [
>>> {
>>> "@type": "d",
>>> "@rid": "#9:-2",
>>> "@version": 0,
>>> "@class": "V",
>>> "x": "x"
>>> }
>>> ]
>>> As you can see the rid is negative.
>>>
>>> Is it possible to get actual rid, and use it in the same js script?
>>>
>>
--
---
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.