What do you mean, like when running a query from Java? So far, all the things I have been doing are building server-side javascript or SQL functions, and calling these through the restful interface from nodejs. I tried a few things with Oriento, but had too many issues, so I haven't been experimenting with that furher lately.
I do most testing by writing queries and executing them through the studio, and if they behave as expected, I can execute them from other places, like javascript functions. But as long as I have these issues, I am a bit stuck :) I needed the update OFunction exactly because the Studio would mess up my javascript code. First I thought it was a studio problem so I started experimenting with updating it manually through a query, which is when I discovered that it's a general OrientDB issue. I think the studio puts documents through the restful interface and it definitely has the same problem. That's all I know so far. Op woensdag 4 juni 2014 09:42:54 UTC+2 schreef Artem Orobets: > > Thanks. Have you tried to pass this strings in parameters? > > Best regards, > Artem Orobets > > *Orient Technologies the Company behind OrientDB* > > > 2014-06-04 10:29 GMT+03:00 MrFT <[email protected] <javascript:>>: > >> >> Issue created here: >> https://github.com/orientechnologies/orientdb/issues/2424 >> >> >> >> Op woensdag 4 juni 2014 09:15:30 UTC+2 schreef Artem Orobets: >>> >>> Hi, >>> >>> You are right there shouldn't be such inconsistency. Could you create a >>> ticket <https://github.com/orientechnologies/orientdb/issues/new>? >>> >>> Best regards, >>> Artem Orobets >>> >>> * Orient Technologiesthe Company behind OrientDB* >>> >>> >>> 2014-06-03 12:04 GMT+03:00 MrFT <[email protected]>: >>> >>>> >>>> I found a workaround using the MERGE command >>>> >>>> update V merge { "value2": "Hello\nWorld! Backslash = \\ " } where key >>>> = "x" >>>> >>>> >>>> BUT there are other strange issues with escaped BACKSLASHES! >>>> >>>> The following FAILS with java.lang.IllegalStateException: Missing >>>> closed string character: '"', position: 75 >>>> update V merge { "value2": "Backslash = \\" } where key = "x" >>>> >>>> while this seems to work >>>> update V merge { "value2": "Backslash = \\ " } where key = "x" >>>> >>>> but when I want to update a javascript function, I have to escape each >>>> backslash twice !!! >>>> >>>> The following will not behave as expected >>>> update OFunction merge { code : "// \\/\\/" } where name = >>>> 'testBackslashInComment' >>>> >>>> A select query on the database will return >>>> "code": "// //" >>>> instead of the expected >>>> "code": "// \\/\\/" >>>> >>>> But the following query >>>> update OFunction *merge* { code : "// \\\\/\\\\/" } where name = >>>> 'testBackslashInComment' >>>> will produce >>>> "code": "// \\/\\/" >>>> >>>> But using SET instead of MERGE, we get: >>>> update OFunction *set* code = "// \\/\\/" where name = >>>> 'testBackslashInComment' >>>> we get the expected >>>> "code": "// \\/\\/" >>>> >>>> (but then we are back to the \n not working...) >>>> >>>> So, could these problems be fixed? >>>> They seem like bugs to me, and OrientDB studio is sufferering from the >>>> same problem when using backslahes in your javascript code (see ticket >>>> https://github.com/orientechnologies/orientdb-studio/issues/75)... >>>> >>>> >>>> >>>> >>>> >>>> Op dinsdag 3 juni 2014 10:26:50 UTC+2 schreef MrFT: >>>> >>>>> Hello, >>>>> I am running queries through OrientDB studio, and I want to store >>>>> newlines in a property. >>>>> >>>>> I tried things like >>>>> >>>>> UPDATE MyClass set mytext = 'Hello*\n*World' >>>>> and >>>>> UPDATE MyClass set mytext = "Hello*\n*World" >>>>> >>>>> but no luck. >>>>> >>>>> How can this be done? Or is it a bug? >>>>> >>>>> (insert into MyClass content { key: 1, mytext: "Hello*\n*World" } does >>>>> work as expected... ) >>>>> >>>>> -- >>>> >>>> --- >>>> 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. >>>> >>> >>> -- >> >> --- >> 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] <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 [email protected]. For more options, visit https://groups.google.com/d/optout.
