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
Does anyone have examples of how to use DBMS_APPLICATION_INFO package with JBOSS? We have
Does anyone have examples/tutorials of exception handling in R? The official documentation is very
I have seen examples of printing from a windows application but I have not
Anybody have good examples of usability disasters? Here's an example. Hector is a manager
We have some examples of pictures. And we have on input set of pictures.
I have code examples from some of my previous work that help me to
I have two examples I have a question about. Let me explain via some
Does anyone have any examples or resources where i might find information on scrolling
I have an application that needs to return search results from a SQL Server

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.