Still don't get the behavoir of embedded.
wrote a test in my ruby-adapter:
140 it "work with a schemaless approach" do
141
142 emb = [1,2,"zu",1]
143 base_document = @base_class.new_document attributes: {
embedded_item: emb }
144 expect(base_document.embedded_item).to eq emb
145
146 base_document.update_embedded :embedded_item, " 45"
147 expect(base_document.embedded_item).to eq emb << " 45"
148
149 reloaded_document = @r.get_document base_document.rid
150 expect(reloaded_document.embedded_item).to eq emb
151
152 end
In short: create a new document with an property »embedded_item« and
assign the ruby-array
then check if the property is present in the created
document (144)
update_embedded (146) sends "update [base_document.rid] add
embedded_item = " 45" to the DB
The test in 147 tests the presence of " 45" in the ruby-array of the
ruby-representation of the DB-Object.
Then – reloading the Object..
The DB-Document should be equal to the ruby-model, in particular the
»embedded_item« property.
but it fails:
>> work with a schemaless approach (FAILED - 1)
>>
>>Failures:
>>
>> 1) REST::Model Operate with an embedded object work with a schemaless
approach
>> Failure/Error: expect(reloaded_document.embedded_item).to eq emb
>>
>> expected: [1, 2, "zu", 1, " 45"]
>> got: [1, 2, "zu", 1, 45]
>>
The String " 45" was converted into a Numeric, the string-properties are
lost.
Perhaps anybody can show me, how to insert the field as string....
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.