What does db.query() return ?

69 views
Skip to first unread message

Gaurav Dhiman

unread,
Mar 20, 2014, 10:09:35 AM3/20/14
to orient-...@googlegroups.com
I am using db.query() in server side JS functions.
What does it acutally return ? Object, Array of Objects or JSON ?

ret = db.query("select from ouser");
What will be the ret ?

If I do ret.name, function gives error. How to access document property in returned result ?


ret = db.query("insert into Profile SET name = 'Jay', surname = 'Miner'");
What will be ret in this case ?

ret = db.query("UPDATE Profile SET nick='Luca' WHERE nick IS NULL");
What will be ret in this case ?

Regards,
Gaurav

Luca Garulli

unread,
Mar 20, 2014, 10:18:04 AM3/20/14
to orient-database
Hi Gaurav,
it returns a ODocument array.

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.

Gaurav Dhiman

unread,
Mar 20, 2014, 4:13:13 PM3/20/14
to orient-...@googlegroups.com

Thanks Luca.

How can we access the property from ODocument ? What are the available methods of ODocument ?

Regards,
Gaurav

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/iMW3pK4RRwE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.

Luca Garulli

unread,
Mar 21, 2014, 5:13:47 AM3/21/14
to orient-database
Hi Gaurav,
you can find this information into the documentation: https://github.com/orientechnologies/orientdb/wiki/Document-Database

Lvc@

Gaurav Dhiman

unread,
Mar 24, 2014, 8:11:14 AM3/24/14
to orient-...@googlegroups.com
Just for reference:

I think the better link to know ODocument methods is below one:

Regards,
Gaurav

Luca Garulli

unread,
Mar 24, 2014, 8:21:17 AM3/24/14
to orient-database

Luca Garulli

unread,
Mar 24, 2014, 8:21:46 AM3/24/14
to orient-database

Gaurav Dhiman

unread,
Mar 24, 2014, 2:08:20 PM3/24/14
to orient-...@googlegroups.com

Thanks Luca ... very useful link to understand object hierarchy of OrientDB. Good link to bookmark :-)

I hope these objects and their properties as well as methods are also accessible in server side JavaScript function code.

Regards,
Gaurav

Luca Garulli

unread,
Mar 24, 2014, 2:16:56 PM3/24/14
to orient-database
Hi,
everything is accessible from JS.

Lvc@
Reply all
Reply to author
Forward
0 new messages