[CSHARP-2075] C# - MapReduce (MongoDB.Driver) does not work when Limit is passed as MapReduceOptions Created: 30/Oct/17  Updated: 05/Apr/19  Resolved: 08/Jan/18

Status: Closed
Project: C# Driver
Component/s: Read Operations
Affects Version/s: 2.4.4
Fix Version/s: None

Type: Task Priority: Critical - P2
Reporter: Rui Ribeiro Assignee: Robert Stam
Resolution: Won't Fix Votes: 0
Labels: question
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-2099 MapReduce does not allow limit as one... Closed

 Description   

Mongo database: 3.0.4
MongoDB.Driver: 2.4.4

I am trying to make a Map reduce from a collection, and as MapReduceOption I am passing the option Limit (e.g. 10).
The database where is this collection is not sharded.

However when i run my code it breaks with this message:
unknown m/r field for sharding: limit



 Comments   
Comment by Robert Stam [ 08/Jan/18 ]

See the related server ticket.

As the server team has decided not to support this I am closing this driver ticket.

You should comment on the server ticket if you wish to encourage the server team to support this scenario.

Comment by Rui Ribeiro [ 15/Nov/17 ]

Any news about this issue?

Comment by Rui Ribeiro [ 03/Nov/17 ]

Yes I am running a sharded cluster, but this collection in particular is not sharded

Comment by Rui Ribeiro [ 03/Nov/17 ]

Thank you for the reply.

I understand that does not work when it is against a sharded collection.
But my map reduce is being applied for a *non sharded collection*.

If I do this: db.abc.getShardDistribution();
It says: Collection abc is not sharded.

Even the output collection of my map reduced I am setting to sharded = false

So why in this scenario it still does not work?

Comment by Robert Stam [ 03/Nov/17 ]

I just noticed that you say the collection you are running the map/reduce against is not sharded.

That's interesting. Can you elaborate? Are you running a sharded cluster, but this one collection is not sharded?

Comment by Robert Stam [ 03/Nov/17 ]

This is actually a limitation of the server, which does not support the limit option when doing a map/reduce against a sharded collection.

See:

https://jira.mongodb.org/browse/SERVER-2099

Generated at Wed Feb 07 21:41:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.