Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion besides emit() in map(), can I simply omit this map-reduce cycle?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
λq  
View profile  
 More options Jul 12 2011, 12:16 am
From: λq <lamb...@gmail.com>
Date: Tue, 12 Jul 2011 12:16:21 +0800
Local: Tues, Jul 12 2011 12:16 am
Subject: Re: [mongodb-user] besides emit() in map(), can I simply omit this map-reduce cycle?

{
  'user': user1,
  'day': '2011-07-09'
  'top-list': [
    {'score': score1, 'date': date1, 'app': app1},
    {'score': score2, 'date': date2, 'app': app2},
    {'score': score3, 'date': date3, 'app': app3},
  ]

},

{
  'user': user1,
  'day': '2011-07-10'
  'top-list': [
    {'score': score1, 'date': date1, 'app': app1},
    {'score': score3, 'date': date3, 'app': app3},
    {'score': score4, 'date': date4, 'app': app4},
  ]
},

{
  'user': user1,
  'day': '2011-07-11'
  'top-list': [
    {'score': score3, 'date': date3, 'app': app3},
    {'score': score4, 'date': date4, 'app': app4},
    {'score': score2, 'date': date2, 'app': app2},
  ]

},

Given app3, return a result like:

{'2011-07-09': 3, '2011-07-10': 2, '2011-07-11': 1}

app3 is at rank #3 place in 2011-07-09, raised to #1 and #1 in the following
days.

But in the collection, app3 is out of the 'top-list'array, so I do not want
the mapReduce() to process this document, yes just a 'query' parameter for
mapReduce() could filter that out, but since I already need to iterate the
whole 'top-list' array in the map() function, I think I don't need 'query'
parameter?

So can I skip a number of documents for a map() ?

2011/7/12 Eliot Horowitz <eliothorow...@gmail.com>

> I'm a bit confused by what you mean.
> Is that a sample document that's in the collection?

> What would the output look like?

> 2011/7/11 λq <lamb...@gmail.com>:
> > Hi guys,
> > I knew that mapReduce() has a query parameter, but in my case,

> > {
> >   'user': user1,
> >   'top-list': [
> >     {'score': score1, 'date': date1, 'app': app1},
> >     {'score': score4, 'date': date4, 'app': app4},
> >     {'score': score3, 'date': date3, 'app': app3},
> >   ]
> > }
> > I want to use mapReduce() to find the history position change of a
> > particular my_app
> > the query parameter can do the job, but IMHO it looks redundant because
> when
> > doing the map(), I have to iterate the 'top-list' array again.
> > Is there something like pass() or omit() besides the standard emit() in
> map
> > function? So mongodb could just skip this round of map-reduce and
> continue
> > next?

> > --
> > You received this message because you are subscribed to the Google Groups
> > "mongodb-user" group.
> > To post to this group, send email to mongodb-user@googlegroups.com.
> > To unsubscribe from this group, send email to
> > mongodb-user+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/mongodb-user?hl=en.

> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com.
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mongodb-user?hl=en.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.