Highly complex M/R job with MongoDB

4 views
Skip to first unread message

Antonio

unread,
Feb 12, 2012, 11:18:45 AM2/12/12
to mongodb-user
Hi guys --

I'm looking to run a complex map reduce that will create a document
for each set of unique IPs grouped by either "twitter", "facebook" and/
or "gplus" fields.

So for the following documents:

{
ip: '194.90.1.5',
twitter: 'john1',
facebook: false,
gplus: 'jo...@gmail.com'
}

{
ip: '194.90.1.6',
twitter: false,
facebook: 'johnny',
gplus: 'jo...@GMAIL.com'
}

{
ip: '127.0.0.1',
twitter: 'john1'
facebook: 'johnny',
gplus: false,
}

{
ip: '127.0.0.1',
twitter: 'elise'
facebook: 'elise',
gplus: false,
}

I will end up with:

{
_id: new MongoId(),
values: {
ips: ['194.90.1.5', '194.90.1.6', '127.0.0.1'],
twitter: 'john1',
facebook: 'johnny',
gplus: 'jo...@gmail.com'
}
}

{
_id: new MongoId(),
values: {
ips: ['127.0.0.1'],
twitter: 'elise',
facebook: 'elise',
gplus: false
}
}

Is this at all possible?

Eliot Horowitz

unread,
Feb 16, 2012, 1:13:58 AM2/16/12
to mongod...@googlegroups.com
I don't think it is based on that description?
What if there are conflicts?

The logic isn't quite setup for map/reduce.

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

Reply all
Reply to author
Forward
0 new messages