What is nosql's option for stored procedures and large arrays?

I have a use case for a nosql data store, but I don't know which one to use:

Each document in my data warehouse has a key for _id and another key as an array of objects. Each object hash element of this array has a key for _elementid and another for color.

I want my proxy server to send an update request to the data store using a substring used as a regular expression that qualifies all documents that match the regular expression. Then I want to put an element on an array of each document of this output. This new element will have the same color for each unshift, but _elementid will be unique for each.

Is there a nosql option that offers such a stored procedure? Does it have limitations on the length of the array?

* EDIT *

(1) DOCUMENT A:

{ _id : "this_is-an-example_10982029822", dataList : [ { _elementid : "999999283902830", color : "blue", }, { _elementid : "99999273682763", color : "red" } ] } DOCUMENT B: { _id : "this_is-an-example_209382093820", dataList : [ { _elementid : "99999182681762", color : "yellow" } ] } 

(2) EXAMPLE OF UPDATE REQUEST

 (let [regex_ready_array ["this_is-an-example" "fetcher" "finder"] fetch_query_regex (str "^" (clojure.string/join "|^" regex_ready_array)) element_template { :_elementid { (rand-int 1000000000000000) } :color "green" } updated_sister_objs (mc/bulk-update connection "arrayStore" {:_id {$regex fetch_query_regex }} "unshift" element_template)]) 

(3) DOCUMENT A:

 { _id : "this_is-an-example_10982029822", dataList : [ { _elementid : "999999146514612", color : "green", }, { _elementid : "999999283902830", color : "blue", }, { _elementid : "99999273682763", color : "red" } ] } DOCUMENT B: { _id : "this_is-an-example_209382093820", dataList : [ { _elementid : "9999997298729873", color : "green", }, { _elementid : "9999918262881762", color : "yellow" } ] } 

* EDIT 2 *

(1) the dataList array can be large (large enough so that the MongoDB 16mb document size limit would present a problem);

(2) the _elementid values ​​assigned to additional dataList elements will be different for each new element, and the store will automatically assign them as random number values

(3) one update request must apply all updates, not one update for an additional item;

(4) The OP is looking for a comparison and contrast between several "nosql solutions" that are offered as possible candidates for MongoDB, Cassandra, Redis, and CouchDB.

+5
source share
1 answer

Seeing your question. As far as I understand, you are using JSON and Clojure.

Let's see which ones are good NoSQL for JSON. A brief overview of populor NoSQL

  • Apache Cassandra: The data model in Cassandra is essentially a hybrid between a key and column-oriented (or tabular) database management system. His data model is a consistency-separated split-string repository.

  • Redis: Redis maps keys to value types. It has some abstract data types other than strings, such as List, Sets, Sorted Sets, Hash Tables, Geospatial data.

  • Apache CouchDB: CouchDB manages a collection of JSON documents.

  • MongoDB: CouchDB manages a collection of BSON documents. BSON is a binary JSON http://bsonspec.org/spec.html .

If you use a lot of useful JSON information, you can use MongoDB or Apache CouchDB. But you want to update JSON based on REGEX.

Lets you check REGEX features for CouchDB and MongoDB

  • This can be done easily with MAP Reduce in both CouchDB and MongoDB

    Regex Select: db.student.find ({f_name: {$ regex: 'this_is-a-example. *'}}). Pretty ();

  • MongoDB: In mongodb, we have regular expression operations. I tried and everything works fine.

Link

Link

You could either with this MongoDB, and with CouchDB. Many resources are available for MongoDB.

0
source

Source: https://habr.com/ru/post/1272309/


All Articles