0

I am trying join two mongoDB collections in my c# code. and trying to follow this example.

But my code give me error on following line. saying MapReduceOptionsBuilder couldnot be found.

var options = new  MapReduceOptionsBuilder();
options.SetOutput(MapReduceOutput.Inline);
options.SetOutput(MapReduceOutput.Reduce("result"));
var result = cLifeExpectancy.MapReduce(life_expect_map, r, options);
result = cEconomicAssistance.MapReduce(us_econ_map, r, options);

I have following Nuget install in my project:

  1. MongoDB.Bson
  2. MongoDB.Driver
  3. MongoDB.Driver.core

following References added.

using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Driver;
using MongoDB.Driver.Builders;

Can someone tell me what am I missing? or share some other example of joining MongoDB collection in C#.net. or alternative of MapReduceOptionsBuilder.

Community
  • 1
  • 1
Fazal Wahid
  • 175
  • 2
  • 17

1 Answers1

0

probably because that class is obsolete. Unless you're using older version of the driver

http://api.mongodb.com/csharp/1.11/html/ebbdbd35-63b2-7656-aca9-8c13a8c57aa4.htm

below link has an example of how to using MapReduceOptions.

Hope this helps MongoDB C# driver 2.0: How to get the result from MapReduceAsync

Community
  • 1
  • 1
KaSh
  • 175
  • 1
  • 11