Hi Ronnie,
OrientDB functions always return such structure. If you want to avoid it
you should work that JSON at server or client side. If on server side you
could create a service exposed via HTTP that extract the result.

Lvc@



On 25 June 2014 03:36, Team Xcelerator Inc. <[email protected]>
wrote:

> I have a custom function which performs a query against a graph db.  The
> result seems to come back in JSON form though it has additional brackets.
> Here is the end result from the query:
>
> var results =
> [{"@type":"d","@rid":"#-2:0","@version":0,"count":0,"@fieldTypes":"count=l"}]
>
> I wish to extract the "count" value out of this string and return it as a
> number from the defined function. I have searched and searched but haven't
> found a good way to do it. The query result seems to be a java.lang.object
> as far as I can tell but it is storing semi-JSON object.  Trying to use
> JSON.parse() fails. My guess is the brackets.
>
> Can you please help me figure out how to return just the count value?  I
> am looking forward to introducing our company to OrientDB.  I am working on
> this proof-of-concept to demonstrate its power.
>
> Thanks,
> Ronnie
>
> --
>
> ---
> 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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to