![]() Given your example data set, you will only get back one document with meeting the requirements (45). For each document z in zuffs, calculate the intersection and look for matchesįOR i IN INTERSECTION(z.passes, z.visits).Find the document you want to match, and get it's intersection product.I'm sure there are other ways to do this, but here's a quick/dirty example: However, it really did not end up being that hard to understand, which made "learning" just a function of time and use. In this instance I have figured out that I will somehow have to use FOR IN along with FILTER but it is not at all clear to me how.īeing a SQL expert, I also fought against the syntax differences of AQL. While there is much I like about ArangoDB I find it unfortunate that it has its own query language instead of just using the required superset of SQL. Take that result and return the hashes for other documents in the same collection that have a non-empty intersection with the the intersection I2 obtained above.Establish the, intersection, I1 of passes and visits for the document bearing the hash 45.It is not clear to me how I would do the following Which Postgres obligingly executes to return the result SELECT UNNEST(a1) INTERSECT SELECT UNNEST(a2))įROM (SELECT passes AS a1,visits as a2 FROM zuffs where hash = 1) q In order to establish the intersection of passes and visits` I would write SELECT ARRAY In Postgres I have a table, zuffs containing rows bearing the following form hash passes visits ![]() I am experimenting with ArangoDB as a replacement for Postgres which I am currently using.
0 Comments
Leave a Reply. |