You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but if I set attribute "LINKEDCLASS" record doesn't save
orientdb {db=test}> create class test2 extends V
Class created successfully. Total classes in database now: 14
orientdb {db=test}> create property test2.list linklist
Property created successfully with id=1
orientdb {db=test}> alter property test2.list linkedclass OUser
Property updated successfully
orientdb {db=test}> insert into test2 set list = [#5:0,null,#5:0]
Error: com.orientechnologies.orient.core.exception.OValidationException: The field 'test2.list' has been declared as LINKLIST but contains a null record (probably a deleted record?)
orientdb {db=test}> insert into test2 content {"list":["#5:0",null,"#5:0"]}
Error: com.orientechnologies.orient.core.exception.OValidationException: The field 'test2.list' has been declared as LINKLIST but contains a null record (probably a deleted record?)
Recorded data is possible if we replace "null" on "#-1:-1"
orientdb {db=test}> insert into test2 set list = [#5:0,#-1:-1,#5:0]
Inserted record 'test2#14:0{list:[3]} v1' in 0,004000 sec(s).
orientdb {db=test}> select list.size() from #14:0
----+------+----
what does it mean to insert a null value in list, when having a linked class? i think it is invalid.
however, you should be able to use ifnull() function (http://orientdb.com/docs/last/SQL-Functions.html#ifnull) to replace null values with #-1:-1 if you really need to handle this situation
sometimes I need insert array with null values because length of an array is important for me
and I want to get back an array of the same length as the insert
when I insert record [#-1:-1,#5:0] that DB returns [null,#5:0]. it is OK for me
why I cannot insert record [null,#5:0] at once
sorry, example above returns array [#5:0] without "null".
DB always cuts first "null" when returning the result
but inside DB record is correct
select list.size() from "this record" => 2
even if I insert [#-1:-1,#-1:-1,#-1:-1,#5:0], DB cuts only first null.
And result query (select from "this record" ) will be [null,null,#5:0]
but if I insert [#5:0,#-1:-1,#5:0] , DB returns correct result [#5:0,null,#5:0]
Hi
I use OrientDB Server v2.0.13
when I use property without "LINKEDCLASS" I can save this record
[#5:0,null,#5:0]
orientdb {db=test}> create class testl extends V
Class created successfully. Total classes in database now: 13
orientdb {db=test}> create property testl.list linklist
Property created successfully with id=1
orientdb {db=test}> insert into testl set list = [#5:0,null,#5:0]
Inserted record 'testl#13:0{list:[3]} v1' in 0,017000 sec(s).
orientdb {db=test}> select list.size() from #13:0
----+------+----
| @ CLASS|list
----+------+----
0 |null |3
----+------+----
1 item(s) found. Query executed in 0.002 sec(s).
orientdb {db=test}> insert into testl content {"list":["#5:0",null,"#5:0"]}
Inserted record 'testl#13:1{list:[3]} v1' in 0,017000 sec(s).
orientdb {db=test}> select list.size() from #13:1
----+------+----
| @ CLASS|list
----+------+----
0 |null |3
----+------+----
1 item(s) found. Query executed in 0.002 sec(s).
but if I set attribute "LINKEDCLASS" record doesn't save
orientdb {db=test}> create class test2 extends V
Class created successfully. Total classes in database now: 14
orientdb {db=test}> create property test2.list linklist
Property created successfully with id=1
orientdb {db=test}> alter property test2.list linkedclass OUser
Property updated successfully
orientdb {db=test}> insert into test2 set list = [#5:0,null,#5:0]
Error: com.orientechnologies.orient.core.exception.OValidationException: The field 'test2.list' has been declared as LINKLIST but contains a null record (probably a deleted record?)
orientdb {db=test}> insert into test2 content {"list":["#5:0",null,"#5:0"]}
Error: com.orientechnologies.orient.core.exception.OValidationException: The field 'test2.list' has been declared as LINKLIST but contains a null record (probably a deleted record?)
Recorded data is possible if we replace "null" on "#-1:-1"
orientdb {db=test}> insert into test2 set list = [#5:0,#-1:-1,#5:0]
Inserted record 'test2#14:0{list:[3]} v1' in 0,004000 sec(s).
orientdb {db=test}> select list.size() from #14:0
----+------+----
| @ CLASS|list
----+------+----
0 |null |3
----+------+----
1 item(s) found. Query executed in 0.002 sec(s).
orientdb {db=test}> insert into test2 content {"list":["#5:0","#-1:-1","#5:0"]}
Inserted record 'test2#14:1{list:[3]} v1' in 0,002000 sec(s).
orientdb {db=test}> select list.size() from #14:1
----+------+----
| @ CLASS|list
----+------+----
0 |null |3
----+------+----
1 item(s) found. Query executed in 0.002 sec(s).
The text was updated successfully, but these errors were encountered: