Query with parameter inside square brackets

38 views
Skip to first unread message

Riccardo Tasso

unread,
Jul 15, 2015, 10:16:30 AM7/15/15
to orient-...@googlegroups.com
Hi,
   I have a query similar to the following in Orient 2.0.12:

SELECT out()[group=:group]
FROM
Person


I execute it from Java, with the following method over ODatabaseDocumentTx:
db.query(query, paramsMap);

It seems that parameters can't be used inside square brackets, as you can see also in the attached UnitTest.

I think this is a bug, can you fix it in 2.0.13 release?
Otherwise can you help me obtaining the same results without this syntax?

Cheers,
   Riccardo
OrientFilterParameterTest.java

Luca Garulli

unread,
Jul 15, 2015, 10:54:28 AM7/15/15
to orient-...@googlegroups.com
Hi Riccardo,
This should already working starting from 2.1.

Best Regards,

Founder & CEO


--

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

Eric24

unread,
Jul 15, 2015, 11:08:20 AM7/15/15
to orient-...@googlegroups.com
@Richard: Just for my education, what does this syntax do?
--Eric

nagaraja sosale ramaswamy

unread,
Jul 15, 2015, 11:18:56 AM7/15/15
to orient-...@googlegroups.com
:group declares a named parameter that allows the caller to pass a value into the query thus making the query dynamic rather than hard coding.
and out()[group = :group] applies a filter on the out() such that only those vertices which contain group property = the passed value are returned

hope that helps

Eric24

unread,
Jul 15, 2015, 11:24:37 AM7/15/15
to orient-...@googlegroups.com
Ah ha! Thanks!

Riccardo Tasso

unread,
Jul 15, 2015, 11:24:59 AM7/15/15
to orient-...@googlegroups.com

2015-07-15 16:54 GMT+02:00 Luca Garulli <l.ga...@orientdb.com>:
This should already working starting from 2.1.

Thank you Luca, I'll try it as soon as possibile.

Riccardo
Reply all
Reply to author
Forward
0 new messages