Hi Luigi,
First of all, thanks for the great work on OrientDB! We've been really
amazed with it. The only major roadblock we have found is functions.
I've been since yesterday trying to implement simple functions in the
studio and the lack of documentation mixed with seemingly changing syntax
makes things quite difficult. i.e.: orient.getGraph() function seems to
work on 2.0.3 but not on 2.0.9 or 2.1-rc2. I have also not been able to run
the code you posted above for Snidgha in any of the versions.
Here is the code we have so far running on 2.0.3:
"
var mydb = orient.getGraph();
var nearbyNodes = mydb.command('sql',"select in('Contributes_To') from "
+originNode);
return nearbyNodes;
"
I would like to iterate through each of the nodes returned from the query.
Inside of each node I would like to apply a javascript function
"propagation()" to the parameter "activation" from that node and change it
accordingly.
What would be the best way to achieve this? It's not a complicated logic,
but even extracting the result from the query object as a simple string has
been proved to be a challenge.
Cheers,
Joao
On Friday, 22 May 2015 09:14:29 UTC+1, Luigi Dell'Aquila wrote:
>
> Hi Snigdha,
>
> Try this:
>
> var gdb = orient.getGraph()
> results = gdb.command("sql", "select name from Person limit 5" )
> for (var r in results) {
> print(results[r])
> print(results[r].getClass())
> }
>
> Regards
>
> Luigi
>
> 2015-05-22 7:33 GMT+02:00 Snigdha Batra <[email protected] <javascript:>>:
>
>> Hi All
>>
>> There is a lack of documentation on Function usages in other languages
>> than Java.
>>
>> I created a test function to execute multiple SQL Statements in a single
>> DB connection.
>>
>> This is my code:
>> var gdb = orient.getGraph()
>> results = gdb.command("sql", "select name from Person limit 5" )
>> print(results.getClass()) // This is an object of type Object[]
>> for (var r in results) {
>> print(r.getClass()) // Thisi is an object of type Integer
>> }
>>
>> I get 0,1,2,3,4 as my result in the server console.
>>
>> How can I get the records as complete rows from the response in the
>> result?
>> I checked the source code and it converts the results into an Array if it
>> is a type of Iterable.
>>
>> Need a little help here.. how do I get data out of the DB and in the
>> correct format?
>>
>> --
>>
>> ---
>> 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.