OR query in orientjs

117 views
Skip to first unread message

Vipul Maheshwari

unread,
Jul 30, 2015, 7:22:38 AM7/30/15
to orient-...@googlegroups.com
Hi,

Can someone please help to write a Or query with orientJs? 

More specifically how to have operators other than equality in OR query in orientjs

Luigi Dell'Aquila

unread,
Jul 31, 2015, 4:55:43 AM7/31/15
to orient-...@googlegroups.com
Hi Vipul,

the easiest way is to use a plain SQL statement, see https://github.com/orientechnologies/orientjs#execute-a-select-query-with-params



2015-07-30 13:22 GMT+02:00 Vipul Maheshwari <vipu...@gmail.com>:
Hi,

Can someone please help to write a Or query with orientJs? 

--

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

Vipul Maheshwari

unread,
Aug 3, 2015, 3:04:04 AM8/3/15
to OrientDB
Hi Luigi,

Thanks for the suggestion, but I was hoping to it using a query builder. I can write queries which have or,and with operator as "=" but if I need to do a "and","or" query with a mixed operators.

For example let's say i have student table with columns as age,name and i want to query 

"select from student where (name = 'abc' and age > 20) or (name = 'pqr' and age > 22) "

How can i achieve this?

I tried  db.select().from('student').or({"name":"abc","age":20},{"name":"pqr","age":40}) but this works fine and gives or query with all operator as equal to
Reply all
Reply to author
Forward
0 new messages