<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:56:34 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[JAVA-2196] use mapReduce  to get some document</title>
                <link>https://jira.mongodb.org/browse/JAVA-2196</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;I need to get a fixed number of doc by per group,when i use the method of mapReduce &#65288;class MongoCollection&#65289;,it is so strange  that the first doc have so many repeat  keys.hope to get your answer,thank you very much.&lt;/p&gt;

&lt;p&gt;the example code&#65306;&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;        String map=&quot;function (){emit(this.domain,{_id:this._id} )}&quot;;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;		&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;		String reduce=&quot;function(key,values){ var str;for(var doc in values){&quot;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;				+ &quot;              str=values[0];break;} return {\&quot;docs\&quot;:str}; }&quot;;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;		MapReduceIterable&amp;lt;Document&amp;gt; mri=collect.mapReduce(map, reduce);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;		MongoCursor&amp;lt;Document&amp;gt; mc=mri.iterator();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;		int n=0;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;		while(mc.hasNext()){&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;			n++;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;			Document doc=mc.next();&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;			System.out.println(doc.toJson());&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;		}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;the output&#65306;&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &quot;_id&quot; : &quot;a.example.com&quot;, &quot;value&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;_id&quot; : &quot;d113e8d2850f0944402f3129318a9043&quot; } } } } } } } } } } } } } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &quot;_id&quot; : &quot;all-femdom-movies.com&quot;, &quot;value&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;_id&quot; : &quot;3238cd2caf98bf7961089e36ca33a67b&quot; } } } } } } } } } } } } } } } } } } } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &quot;_id&quot; : &quot;b.example.com&quot;, &quot;value&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;_id&quot; : &quot;ad8200df9d862631a8e3420c3185e210&quot; } } } } } } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &quot;_id&quot; : &quot;c.example.com&quot;, &quot;value&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;_id&quot; : &quot;120eb8ade2d0665feb599748c3bd3c1d&quot; } } } } } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &quot;_id&quot; : &quot;d.example.com&quot;, &quot;value&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;_id&quot; : &quot;74d321593f289d25400ddfc712ddfa4b&quot; } } } } } } } } } } } } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &quot;_id&quot; : &quot;e.example.com&quot;, &quot;value&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;_id&quot; : &quot;c25bfbc7ea131affd9458680a40f7e18&quot; } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &quot;_id&quot; : &quot;f.example.com&quot;, &quot;value&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;_id&quot; : &quot;9343cff09d737eee511663898cd794cc&quot; } } } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &quot;_id&quot; : &quot;g.example.com&quot;, &quot;value&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;_id&quot; : &quot;ef1be6af33be28752a3998bc24d515fe&quot; } } } } } } } } } } } } } } } } } } } } } } } } } } } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &quot;_id&quot; : &quot;h.example.com&quot;, &quot;value&quot; : { &quot;docs&quot; : { &quot;_id&quot; : &quot;1f540dd64fd45200e5ed0d51a0551546&quot; } } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &quot;_id&quot; : &quot;i.example.com&quot;, &quot;value&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;_id&quot; : &quot;5cc7831ac9b088987f5eb48e78ff0c46&quot; } } } } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &quot;_id&quot; : &quot;j.example.com&quot;, &quot;value&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;docs&quot; : { &quot;_id&quot; : &quot;e47a5c01101395d25ff36c2be3d7af1d&quot; } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;&lt;b&gt;Edit:&lt;/b&gt; Sanitised the domain names in the example.&lt;/p&gt;</description>
                <environment>window7&#12289;eclipse&#65288;Mars Release (4.5.0)&#65289;&#12289;jdk1.6.0_45</environment>
        <key id="289522">JAVA-2196</key>
            <summary>use mapReduce  to get some document</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="km1218">km1218</reporter>
                        <labels>
                    </labels>
                <created>Thu, 26 May 2016 03:24:33 +0000</created>
                <updated>Wed, 11 Sep 2019 19:13:11 +0000</updated>
                            <resolved>Thu, 26 May 2016 09:16:28 +0000</resolved>
                                    <version>3.2.2</version>
                                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1275986" author="ross@10gen.com" created="Thu, 26 May 2016 09:16:28 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Just to let you know this project is for Java driver bugs or feature requests.  The best place for questions regarding MongoDB usage or the Java driver specifics is the &lt;a href=&quot;https://groups.google.com/forum/#!forum/mongodb-user&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb-user mailing list&lt;/a&gt; or &lt;a href=&quot;http://stackoverflow.com&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;stackoverflow&lt;/a&gt; as you will reach a boarder audience there.  If your business requires an answer from MongoDB within a set time frame then we do offer &lt;a href=&quot;https://www.mongodb.com/products/production-support&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;production support&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I&apos;m closing this as &quot;Works as designed&quot; because it is possible to invoke the reduce function more than once for the same key. &lt;/p&gt;

&lt;p&gt;You need to update your reduce function so that the following properties are true:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;the &lt;em&gt;type&lt;/em&gt; of the return object must be identical to the type of the value emitted by the map function.&lt;/li&gt;
	&lt;li&gt;the reduce function must be associative. The following statement must be true:&lt;br/&gt;
     &lt;tt&gt;reduce(key, [ C, reduce(key, [ A, B ]) ] ) == reduce( key, [ C, A, B ] )&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;the reduce function must be idempotent. Ensure that the following statement is true:&lt;br/&gt;
    &lt;tt&gt;reduce( key, [ reduce(key, valuesArray) ] ) == reduce( key, valuesArray )&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;the reduce function should be commutative: that is, the order of the elements in the valuesArray should not affect the output of the reduce function, so that the following statement is true:&lt;br/&gt;
    &lt;tt&gt;reduce( key, [ A, B ] ) == reduce( key, [ B, A ] )&lt;/tt&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Please see the &lt;a href=&quot;https://docs.mongodb.com/manual/reference/command/mapReduce&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mapReduce&lt;/a&gt; documentation for more information.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hslu1j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>