[CSHARP-1502] db.RunCommand() does work for "find" command in c# Created: 11/Dec/15  Updated: 05/Apr/19  Resolved: 11/Dec/15

Status: Closed
Project: C# Driver
Component/s: API
Affects Version/s: 1.10.1
Fix Version/s: None

Type: Task Priority: Blocker - P1
Reporter: Nikhil Salunkhe Assignee: Unassigned
Resolution: Done Votes: 0
Labels: question
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS: Windows 8
Visual Studio 2015
.NET API - 1.10.1.73
Mongo:

{ "version" : "3.0.7", "gitVersion" : "6ce7cbe8c6b899552dadd907604559806aa2e9bd", "targetMinOS" : "Windows 7/Windows Server 2008 R2", "OpenSSLVersion" : "OpenSSL 1.0.1p-fips 9 Jul 2015", "sysInfo" : "windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB_VERSION=1_49", "versionArray" : [ 3, 0, 7, 0 ], "loaderFlags" : "", "compilerFlags" : "/TP /nologo /EHsc /W3 /wd4355 /wd4800 /wd4267 /wd4244 /wd4290 /wd4068 /wd4351 /we4099 /we4930 /Z7 /errorReport:none /MD /O2 /Oy- /Gw /Gy /Zc:inline", "allocator" : "tcmalloc", "javascriptEngine" : "V8", "bits" : 64, "debug" : false, "maxBsonObjectSize" : 1.67772e+007, "ok" : 1.0000000000000000 }

Attachments: Text File code.txt    
Issue Links:
Duplicate
is duplicated by CSHARP-1513 How to run query specified below usin... Closed

 Description   

I am running following command in C# using mongo .NET AP.

 var client = new MongoClient();
 var database = client.GetServer().GetDatabase("MarketData");
 var command = new CommandDocument
             {
                { "find", "equity"}
            };
CommandResult result = database.RunCommand(command);

And Error I see is:
MongoCommandException was unhandled.
Command 'find' failed: find command not yet implemented (response:

{ "ok" : 0.0, "errmsg" : "find command not yet implemented" }

)



 Comments   
Comment by Nikhil Salunkhe [ 11/Dec/15 ]

Thank you very much. It works now.

On Fri, Dec 11, 2015 at 3:43 PM, Nikhil Salunke <nikhilsalunkhe@gmail.com>

Comment by Nikhil Salunkhe [ 11/Dec/15 ]

Thansk you!

Where can I download Mongo 3.2.0?

On Fri, Dec 11, 2015 at 3:41 PM, Craig Wilson (JIRA) <jira@mongodb.org>

Comment by Craig Wilson [ 11/Dec/15 ]

Hi Nikhil,

You are using version 3.0.7 of the server. The find command was not introduced until server version 3.2.0. You'll need to upgrade your server in order to use the find command.

On a separate note, there is no need for you to manually invoke the find command anyways. The 1.11 and 2.2.0 drivers will use the find command automatically when it is available when you using a collection.Find call.

Craig

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