0

I am trying to do a UNION operation in Aerospike(No-Sql database). However there is no such operation provided by it's query language.

How we can go for a UNION operation in a No-Sql database like Aerospike. I believe this is also applicable to other NoSql database like Couchbase, as I cannot find a supported construct in them as well.

As an example, Let's say I have a collection {key1:value1, key2:value2, key3:value3}. I would be interested in getting the set of collections as follows.

SELECT * from  namespace.collections where key2 = someValue and key1=someValue
UNION
SELECT * from namespace.collections where key1 = someValue and key3=someValue
Didier Spezia
  • 70,911
  • 12
  • 189
  • 154
Love Hasija
  • 2,528
  • 2
  • 27
  • 26

2 Answers2

2

Aerospike does not support UNIONs or JOINs natively. I do not know any NoSQL database which supports this.

sunil
  • 3,507
  • 18
  • 25
0

I first learned about Aerospike after your question, but i'm working with Couchbase for about half a year. If I understood correctly the principle of operation of these databases is the same. We have a very large and non-trivial hashmap and can only perform get and set operations. No UNION, no JOIN, no other relational operations on sets. So, we can only solve this problem on our client side by out custom way. We can get from DB "Bin" or "Json" and combine them in the way we think is right. If you tell us more about your problem, I'll gladly try to help you.

  • I am looking at utilizing views/server side scripts to do a map-reduce on server. So, pulling things back to client and doing a union won't work. – Love Hasija Nov 05 '13 at 16:27
  • 1
    Under the client part I meant API, that you use to interact with your database. You can write your layer between user and server, which will handle the processing of response from DB on user's request. – Vladislav Koroteev Nov 05 '13 at 23:43