Execute mongodb shell script via C# driver
I have read this question and haven't understand. Is there ability to execute arbitrary mongodb shell script via C# driver? var mongoServer = MongoServer.Create("mongodb://<connectionstring>"); var database = mongoServer.GetDatabase("mydatabase"); string mycollectionCount database.Eval("function() { return db.mycollection.count(); }").ToString(); This is useful when you are trying to change property types for example like this: string updateScript = @" function () { db.some_items.find().forEach(function(documentItem) { documentItem.some_collection.forEach(function(collectionItem) { if (typeof