[CSHARP-1237] The find fluent api should output shell syntax on ToString() Created: 08/Apr/15 Updated: 16/Jul/15 Resolved: 01/May/15 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | API |
| Affects Version/s: | 2.0 |
| Fix Version/s: | 2.0.1, 2.1 |
| Type: | Improvement | Priority: | Trivial - P5 |
| Reporter: | Craig Wilson | Assignee: | Craig Wilson |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
When calling ToString() on the aggregate fluent api outputs a shell compatible syntax of the current pipeline. The same thing should be done for find. |
| Comments |
| Comment by Roberto Pérez [ 02/May/15 ] |
|
Thanks for your quick response. I was thinking in something similar like "Database.Log" in EntityFramework, where, you can redirected all translated queries, updates, deletes and inserts to, for example, the Console. Anyway, I really appreciate what you have just done Thanks! |
| Comment by Craig Wilson [ 02/May/15 ] |
|
Hi Roberto, That's not possible. We can do this for Find() and for Aggregate() because they return a type we have control over. However, DeleteOneAsync, for instance, returns a Task<DeleteOneResult>. We can't add a ToString() implementation to it. Craig |
| Comment by Roberto Pérez [ 02/May/15 ] |
|
Thank you very much for your implementation. However, I think that it would be desirable to have this .ToString() implementation for every method of the IMongoCollection<TDocument> interface. (DeleteOneAsync, FindOneAndReplaceAsync, UpdateManyAsync...) Regards |
| Comment by Githook User [ 01/May/15 ] |
|
Author: {u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}Message: |
| Comment by Githook User [ 01/May/15 ] |
|
Author: {u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}Message: |