binary protocol

68 views
Skip to first unread message

Zlatko Fedor

unread,
Apr 12, 2015, 9:09:22 AM4/12/15
to orient-...@googlegroups.com
I used query (orientdb version 2.0.6):
UPDATE #17:0 SET title = "{\"name\":\"adam\"}", paragraphs= [{ "@type": "document", "@class": "BlogAParagraphs", "options": "{\"name\":\"adam\"}"}] RETURN after @this


Orientdb returns with binnary protocol:

Blog@user:#17:0,title:"{\"name\":\"adam\"}",paragraphs:[(BlogAParagraphs@@type:"document",options:"{\\\"name\\\":\\\"adam\\\"}")],@type:"document"

for Original object:

{ 
  title: "{\"name\":\"adam\"}", 
  paragraphs: [{ 
    options: "{\"name\":\"adam\"}" 
  }] 
}

FYI: title and options is same and paragraphs is embedded list of objects.

Why is there an one more escape ?

There is another question about same issue
orientdb-bug.png

l.garulli

unread,
Apr 13, 2015, 9:33:32 AM4/13/15
to orient-...@googlegroups.com
Hi Zlatko,
Why did you passed everything as string? Use this:

UPDATE #9:0 SET title = {"name":"adam"}, paragraphs= [{ "@class": "BlogAParagraphs", "options": {"name":"adam"}}] RETURN after @this

Lvc@
There is another question about same issue. I have a really bad feeling about orientdb right now. Because I spent one month with it and there is a lot of "small" but serious bugs.
In my opinion it is really not ready for production use

Zlatko Fedor

unread,
Apr 13, 2015, 6:22:25 PM4/13/15
to orient-...@googlegroups.com

It was example because fields options and title have a type String. I need to save character " but orientdb will always add \\ for embedded documents. In another words if someone will save character " in next refresh of the page he will see \" instead ". Can you confirm? Is it bug or feature of the orientdb

--

---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/2zHHMZFxAeg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luca Garulli

unread,
Apr 13, 2015, 6:51:32 PM4/13/15
to orient-...@googlegroups.com
Zlatko,
Have you tried my query?

Lvc@


--

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

For more options, visit https://groups.google.com/d/optout.



--
Best Regards,

Luca Garulli
CEO at Orient Technologies LTD
the Company behind OrientDB

Zlatko Fedor

unread,
Apr 13, 2015, 7:53:02 PM4/13/15
to orient-...@googlegroups.com
Luca,

yes I tried. It is not working. 
And it can not working because as I said fields title and options have a type STRING and I have a schema for that.
And more fun is that this query: UPDATE #17:0 SET title = {"name":"adam"} will save "{name=adam}". OMG (but I can understand this conversion because it is not a string)
Anyway, maybe your are confused that I am tring to save object as string. Here is a different example:

UPDATE #17:0 SET title = "He said \"hello\".", paragraphs= [{ "@type": "document", "@class": "BlogAParagraphs", "options": "He said \"hello\"."}] RETURN after @this

I will get: title = 'He said "hello".'  which is OK but for paragraphs.0.options = ''He said \\\"hello\\\".' which is WRONG

Thanks

Dňa utorok, 14. apríla 2015 10:51:32 UTC+12 l.garulli napísal(-a):

Luca Garulli

unread,
Apr 14, 2015, 2:33:20 AM4/14/15
to orient-...@googlegroups.com

Which version are you using? I tried 2.0.7-SNAPSHOT and my query worked.

Il 14/Apr/2015 01:53, "Zlatko Fedor" <zfe...@gmail.com> ha scritto:
Luca,

yes I tried. It is not working. 
And it can not working because as I said fields title and options have a type STRING and I have a schema for that.
And more fun is that this query: UPDATE #17:0 SET title = {"name":"adam"} will save "{name=adam}". OMG

Zlatko Fedor

unread,
Apr 14, 2015, 3:20:23 AM4/14/15
to orient-...@googlegroups.com
Luca,

I used 2.0.6. Did you read my comments?

Dňa utorok, 14. apríla 2015 18:33:20 UTC+12 l.garulli napísal(-a):

Zlatko Fedor

unread,
Apr 14, 2015, 5:36:13 AM4/14/15
to orient-...@googlegroups.com
I investigated this issue more. It is only for strings in the embedded documents. 
I created a issue on github for that https://github.com/orientechnologies/orientdb/issues/3923

Dňa utorok, 14. apríla 2015 19:20:23 UTC+12 Zlatko Fedor napísal(-a):
Reply all
Reply to author
Forward
0 new messages