So I have Riak running on 2 EC2 servers, using python to run javascript Mapreduce. They have been clustered. Mainly used for "proof of concept".   There are 50 keys in the bucket, all the map/reduce function does is re-format the data. This i...
I'm using what seems to be a common trick for creating a join view:  // a Customer has many Orders; show them together in one view: function(doc) {   if (doc.Type == "customer") {     emit([doc._id, 0], doc);   } else if (doc.Type == "...
I have a query where I need to return 10 of "Type A" records, while returning all other records. How can I accomplish this?  Update: Admittedly, I could do this with two queries, but I wanted to avoid that, if possible, thinking it would be l...
I'm trying to use reduce to return an array like so:  var myArray = [1,2,3]; _.reduce(myArray, function (seed, item) { return seed.push(item);}, []);   I expect that it will produce an array just like myArray. Instead for the first item, seed is...
I have a M/R function, and I get NaN as a value for some of the results. I dont have any experience with JS. Im escaping JS using Java Drivers.  String map = "function(){" + " emit({"             + "country: this.info.location.cou...
var t = [-12, 57, 22, 12, -120, -3];  t.map(Math.abs).reduce(function(current, previousResult) {     return Math.min(current, previousResult); }); // returns 3  t.map(Math.abs).reduce(Math.min); // returns NaN   I don't understand why the second...
I have 100 documents in my mongoDB, assuming each of them are possible duplicate with other document(s) in different conditions, such as firstName & lastName, email and mobile phone.  I am trying to mapReduce these 100 documents to have the key-v...
Are there any techniques for emulating couchdb's incremental MapReduce in Mongodb. Essentially, we want to a periodic map reduce to only touch new documents in a collection.   Could we use finalize to mark documents as 'old' and then filt...
Problem: I do not understand how reduce is assigning/reducing the customer name from the array. I need for someone to please explain precisely what is happening here.   Detailed Description  In episode 4 of Fun Fun Function's functional programmi...
I have to make some code which filter active user with couchbase, node.js  I have some users documents, and I made a view with the following coded :   I made a view called "bydate" with the following code :  function (doc, meta) {       if(me...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.