[CSHARP-1440] Is there option to run javascript from c# except eval Created: 08/Oct/15 Updated: 05/Apr/19 Resolved: 08/Oct/15 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | rajesh | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | question | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Hello, Is there other option to run javascript which might contains multiple mapreduce? and return list of bsondocument ? I tried eval to run but through error and showing map reduce not supported in eval. I want to run following script from c# and get result. ------------------------------ ) var serviceProviderMap = function(){ ) ); var r = function(key, values){ values.forEach(function(value) { if(value.providers!=null ) { result.providers = result.providers.concat(value.providers); } }); var a=db.services.mapReduce(servicemap, r, {out: {reduce : 'services_providers'}}); var b =db.serviceProviders.mapReduce(serviceProviderMap, r, {out: {reduce : 'services_providers'}}); db.services_providers.aggregate([ , ------------------------------------ this script run properly in mongo command prompt. and showing result. |
| Comments |
| Comment by Craig Wilson [ 08/Oct/15 ] |
|
Hi Rajesh, The MongoDB user group is a much better place to ask these types of questions: https://groups.google.com/forum/#!forum/mongodb-user. We use JIRA for bug tracking and feature requests. To answer your question, no. The .NET driver cannot be used to run shell commands. You'll need to rewrite your script to use the .NET driver. Craig |