When executing a query just like the one below, but on a Document class 
rather than a vertex class, using the JSON list bracket notation results in 
the following error:

*orientdb {db=foo}> insert into inspection_reports set extension="pdf", 
filehash="somehash", notes=[{"@type":"d", "content":"some content", 
"date":"datestring"}]*
*Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: 
Error parsing query:*
*insert into inspection_reports set extension="pdf", filehash="somehash", 
notes=[{"@class":"note", "@type":"d", "content":"some content", 
"date":"datestring"}*                                                      
                
*Encountered " "[" "[ "" at line 1, column 80.*

This is from the console while attached to remote:localhost. *notes *is an 
*embeddedlist 
*type within *inspection_reports*

I've tried more than a few permutations of @class, @type, with brackets, 
without brackets. Any got any pointers?

On Wednesday, July 11, 2018 at 2:32:08 AM UTC-4, Luigi Dell'Aquila wrote:
>
> Hi,
>
> When you have an embedded list property, you have to pass a list to make 
> it work. You are passing a single document now.
> Please try the following:
>
> CREATE VERTEX Profile SET name = "John", phone = [{ "@type":"d", "number" 
> : "212" }]
>
> Thanks
>
> Luigi
>
>
> Il giorno mer 11 lug 2018 alle ore 06:17 Paarek <part...@gmail.com 
> <javascript:>> ha scritto:
>
>>
>> Hi! I am using OrientDB3.0.2 and need to use embeddedList (or embeddedSet)
>>
>> I tried following but does not work, not sure why. Any help is much 
>> appreciated.
>>
>> --------------
>> Schema:
>> create class Phone EXTENDS V
>> create property Phone.number String
>>
>> create class Profile EXTENDS V
>> create property Profile.name String
>> create property Profile.phone embeddedList Phone
>>
>> --------------
>> CREATE VERTEX Profile CONTENT { "name" : "John", "phone" : {"@type":"d", 
>> "number" : "212" }}
>> CREATE VERTEX Profile SET name = "John", phone = { "@type":"d", "number" 
>> : "212" }
>> INSERT INTO Profile (name, phone) VALUES ("John", { "@type": "d", 
>> "number": "212", "@version": 0 })
>>
>> Results In:
>>
>> Error: com.orientechnologies.orient.core.exception.OValidationException: 
>> The field 'Profile.phone' has been declared as EMBEDDEDLIST but an 
>> incompatible type is used. Value: 212
>>
>>
>>
>> -- But following Works because profile has no address property -- 
>>
>> INSERT INTO Profile (name, address) VALUES ('John', { "@type": "d", 
>> "number": "212", "@version": 0 })
>>
>> --------------
>>
>> I tried the same with Java but also getting exception as follows:
>>
>>
>> com.orientechnologies.orient.core.exception.OValidationException: The 
>> field 'Profile.phone' has been declared as EMBEDDEDLIST but an incompatible 
>> type is used.
>> at 
>> com.orientechnologies.orient.core.record.impl.ODocument.validateEmbedded(ODocument.java:814)
>>  
>> at 
>> com.orientechnologies.orient.core.record.impl.ODocument.validateField(ODocument.java:601)
>>  
>> at 
>> com.orientechnologies.orient.core.record.impl.ODocument.validate(ODocument.java:2364)
>>  
>> at 
>> com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.saveInternal(ODatabaseDocumentAbstract.java:2039)
>>  
>> at 
>> com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.save(ODatabaseDocumentAbstract.java:2019)
>>  
>> at 
>> com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.save(ODatabaseDocumentAbstract.java:84)
>>  
>> at 
>> com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:2108)
>>  
>> at 
>> com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:2099)
>>  
>> at 
>> com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:63)
>>  
>> at 
>> com.sqad.repository.OrientDBOperationsImpl.updateVertexProperty(OrientDBOperationsImpl.java:330)
>>
>> -- 
>>
>> --- 
>> 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 orient-databa...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>

-- 

--- 
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 orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to