Roman
Roman

Reputation: 10403

Does MongoDB ignore calling Reduce function when Map emits one result?

I notice that when the Map function returns one entry, then Reduce doesn't get called.

  1. Is this the default behaviour?
  2. Can MongoDB be forced to always call the Reduce function?

Upvotes: 1

Views: 217

Answers (1)

Roman
Roman

Reputation: 10403

Apparently MongoDB develipers decided to optimize MapReduce queries by ignoring Reduce function for unique keys as explained here.

Upvotes: 2

Related Questions