Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7040947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:58:44+00:00 2026-05-28T01:58:44+00:00

I have 2 examples: results = coll.group( key={ip: 1, id : 1 }, condition=

  • 0

I have 2 examples:

results = coll.group( key={"ip": 1, "id" : 1 }, condition= {}, initial={},
reduce="function(obj,prev) {}" )
print len(results)

and:

map = Code(
"function () {"
"emit({ id: this.id, ip: this.ip}, {count: 1});"
"}"
)

reduce = Code("function (key, values) {""}")
result = coll.map_reduce(map, reduce, "map_reduce_example")
print result.count()

Why second example more slowly than first ? I want to use 2 example instead of 1 example because 1 example not work for more than 20000 uniq key.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:58:45+00:00Added an answer on May 28, 2026 at 1:58 am

    When you’re running map/reduce, your map and reduce functions are executed in javascript runtime (which is slower than native C++ code). This also involves some locking (JS locks, read locks, write locks).

    group, on the other hand, might be executed more efficiently (more native code, less locks, etc).

    Note that in a sharded enviroment, map/reduce is your only option for now (in future versions you’ll be able to use Aggregation Framework).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On a report I have the following code for a field: =Sum([PartQty]*[ModuleQty]) Example results
i have task which takes a parameter and has three modes of results Example
Does anyone have examples/tutorials of exception handling in R? The official documentation is very
I have found examples here: Android - Intent that open widget context menu and
I have seen examples of creating a Facelets page template where each defined region
I have some examples on phone number, as shown below: 0810-093-485-58 0811.4845.5677 0812 567
I have seen examples on the site that deal with generics with multiple parameters
The only examples I have been able to find of people using $.each are
I have searched many a page of Google results as well as here on
I have a IList of objects. They are of type NHibernate.Examples.QuickStart.User. There is also

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.