Hi alltogether

if I work in schemless-mode  strange things are happening.

I start with an empty class »NewTest" using the activeOrient-Ruby interface

first_record =  ThisTest.new_document attributes: { normal_array: [1,2,3,'z'
,'u'], some_link: "#33:0" }


Querying the class in studio returns this json

{
    "result": [
        {
            "@type": "d",
            "@rid": "#41:0",
            "@version": 1,
            "@class": "ThisTest",
            "normal_array": [
                1,
                2,
                3,
                "z",
                "u"
            ],
            "some_link": "#33:0",
            "@fieldTypes": "some_link=x"
        }
    ],

(as expected)

Lets extend the record with an embedded list of links.
I expect the apearance of another @fieldtype-entry – but:

> first_record.update set: { link_array: [ "#32:0", '#32:3', '#32:29' ] }
 => #<REST::Model::ThisTest:0x00000003752850 
       @metadata={"type"=>"d", "class"=>"ThisTest", "version"=>2, 
"fieldTypes"=>"some_link=x", "cluster"=>41, "record"=>0}, 
       @attributes={"normal_array"=>[1, 2, 3, "z", "u"], 
                    "some_link"=>"#33:0", 
                    "created_at"=>2015-07-29 19:26:08 +0200, 
                    "updated_at"=>2015-07-29 19:26:08 +0200, 
                    "link_array"=>["#32:0", "#32:3", "#32:29"]}> 

> first_record.link_array
 => [#<REST::Model::Minute:0x000000036c7070 
        @metadata={"type"=>"d", "class"=>"Minute", "version"=>1, 
"fieldTypes"=>nil, "cluster"=>32, "record"=>0}, 
        @attributes={"label"=>0, "created_at"=>2015-07-29 19:32:19 +0200, 
"updated_at"=>2015-07-29 19:32:19 +0200}>, 
     #<REST::Model::Minute:0x0000000369fdb8 
        @metadata={"type"=>"d", "class"=>"Minute", "version"=>1, 
"fieldTypes"=>nil, "cluster"=>32, "record"=>3}, 
        @attributes={"label"=>3, "created_at"=>2015-07-29 19:32:19 +0200, 
"updated_at"=>2015-07-29 19:32:19 +0200}>, 
     #<REST::Model::Minute:0x000000036967b8 
        @metadata={"type"=>"d", "class"=>"Minute", "version"=>1, 
"fieldTypes"=>nil, "cluster"=>32, "record"=>29}, 
        @attributes={"label"=>29, "created_at"=>2015-07-29 19:32:19 +0200, 
"updated_at"=>2015-07-29 19:32:19 +0200}>] 


Orientdb is using a smart autoloading-feature which resolves the links 
correctly.
The result is similar to the findings in Studio.

The json confirms the activeOrient output: only one @fieldtype entry:
{
    "result": [
        {
            "@type": "d",
            "@rid": "#41:0",
            "@version": 2,
            "@class": "ThisTest",
            "normal_array": [
                1,
                2,
                3,
                "z",
                "u"
            ],
            "some_link": "#33:0",
            "created_at": "2015-07-29T19:26:08.313 02:00",
            "updated_at": "2015-07-29T19:26:08.313 02:00",
            "link_array": [
                "#32:0",
                "#32:3",
                "#32:29"
            ],
            "@fieldTypes": "some_link=x"
        }
    ],


Why is the embedded list not included in @fieldtypes?
After reading the documentation I thought, the @fieldtypes are used to 
define special data-formats and I want to implement a more robust 
autoloading, which reflects the database-definitions rather then relying on 
string-pattern.

Thanks in advance 

Hartmut

-- 

--- 
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