[CSHARP-274] The overloads of Insert and Save in MongoCollection should match Created: 21/Jul/11 Updated: 02/Apr/15 Resolved: 22/Jul/11 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.1 |
| Fix Version/s: | 1.2 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Robert Stam | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Right now Insert has two more overloads than Save. Make them match. |
| Comments |
| Comment by Robert Stam [ 22/Jul/11 ] |
|
Not likely we could retire the Save method. All the drivers have one, and we want consistency as much as possible between drivers. |
| Comment by Roman Kuzmin [ 22/Jul/11 ] |
|
Just a thought to consider, not really a suggestion: an alternative might be to retire the whole Save() method set and to introduce an option in some Insert() methods that tells to perform save/upsert. Advantages: this ticket would not exist if (...) Instead, it might be: InsertOptions options = ...; The second version presumably will have advantages in some scenarios. P.S. My PowerShell module (just a few helper cmdlets) follows this idea: it has the Add-Mongo cmdlet with the -Save switch. There is no Save-Mongo spouse there. |
| Comment by Robert Stam [ 21/Jul/11 ] |
|
OK, thanks. Now I know why you encountered this. A C# user probably wouldn't have noticed, but it needs to be addressed nonetheless. |
| Comment by Roman Kuzmin [ 21/Jul/11 ] |
|
Here is the example PowerShell code that shows the issue: ##### Add-Type -Path MongoDB.Driver.dll $doc = New-Object MongoDB.Bson.BsonDocument
##### |