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 8340803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:16:48+00:00 2026-06-09T05:16:48+00:00

I am using the MongoEngine map_reduce functionality in python. According to the MongoDB documentation

  • 0

I am using the MongoEngine map_reduce functionality in python.

According to the MongoDB documentation located here, it is possible to specify the way reduced data is handled. Specifically, it is possible to provide an argument to either “Replace,” “Merge,” “Reduce,” or perform the mapping/reduction “inline.”

I am unable to find instructions on how to specify similar parameters to the MongoEngine map_reduce function. The documentation for the function can be found here.

Could someone explain how I could merge the results of a map_reduce operation into an already existing collection? I cannot perform the map_reduce operation inline.

I am using the following code to perform the map_reduce operation:

map_f = """
    #javascript code
"""

reduce_f = """
    #javascript code
"""

for i in FOO.objects.map_reduce(map_f, reduce_f, "FOOResult"):
    pass

Above, “FOOResult” is a new collection where a specific key will be overwritten each time the mapreduce operation occurs. I would much rather specify something that will allow me insert the same key into a collection that already exists.

Thank you for your help.

  • 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-06-09T05:16:50+00:00Added an answer on June 9, 2026 at 5:16 am

    Well I feel a bit silly for not recognizing this.

    Solution:

    for i in FOO.objects.map_reduce(map_f, reduce_f, {"merge":"COLLECTION_NAME"}):
        pass
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using python's mongoengine to query MongoDB, and have loved it for the most
Using import datetime in python, is it possible to take a formatted time/date string
I have a database tumblelog (using mongoengine) in which I added some data in
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
I am using mongoengine and would like to run connect() after settings (not inside
Using SQL Server 2008 R2 we are looking for a way to select the
Using Android TelephonyManager an application can obtain the state of data activity over the
I have a document and a embedded document using MongoEngine class Sub(EmbeddedDocument): Id =
I am trying out MongoEngine , a DRM library for Python to use with
I am currently working an a webapp, using mongoengine and django, which will require

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.