query and aggregation framework inside map/reduce function

143 views
Skip to first unread message

Martinus Martinus

unread,
Apr 22, 2012, 11:12:33 PM4/22/12
to mongod...@googlegroups.com
Hi,

Can I used query inside map/reduce function? Can I also used aggregation framework inside the map/reduce function? If it's can't, what is the reason I shouldn't query or do aggregation inside the map/reduce function?

Thanks.

Scott Hernandez

unread,
Apr 22, 2012, 11:32:01 PM4/22/12
to mongod...@googlegroups.com
In short, no.

The map/reduce phases are meant to be parallelized and to not require
any other input. You are passed all the data you need to work with in
those functions. They are run in ways where the rest of the
database/system may not be available -- like on shards, in a sharded
cluster where only a subset of data is available locally.

> --
> 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