[CSHARP-633] LINQ queries against collections of type MongoCollection<BsonDocument> are not supported Created: 23/Nov/12 Updated: 02/Apr/15 Resolved: 22/Nov/13 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.6.1 |
| Fix Version/s: | 1.9 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Teodor Georgiev | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
var collection = database.GetCollection("testconnection"); p.Id = Guid.NewGuid(); this is giving an error. I have attached a sample project and you can see it there. |
| Comments |
| Comment by Craig Wilson [ 22/Nov/13 ] | ||||
|
RC in December. Probably full release in early January. | ||||
| Comment by Nebojsa Veron [ 22/Nov/13 ] | ||||
|
Sounds great, when do you think 1.9 driver will be released? | ||||
| Comment by Craig Wilson [ 22/Nov/13 ] | ||||
|
This has been added to 1.9 and is already in master branch. Syntax would look like this:
| ||||
| Comment by Nebojsa Veron [ 21/Nov/13 ] | ||||
|
This is still not supported in version 1.8.3? | ||||
| Comment by Teodor Georgiev [ 26/Nov/12 ] | ||||
|
Probably will go with Linq provider. That's not so complicated. I have done it already couple of times. Thank you for the response. | ||||
| Comment by Craig Wilson [ 26/Nov/12 ] | ||||
|
Well, it's now on the list and we won't remove it. Also, feel free to submit a pull request at github adding this support into the existing linq provider. That's probably much simpler than rewriting it... | ||||
| Comment by Teodor Georgiev [ 26/Nov/12 ] | ||||
|
Currently I am trying to build a framework based on C# that is using partially dynamic partially strongly typed objects. That's why i am using BsonDocument. Apart of that i would like to have a way to query object's dynamic properties and this is the reason why I am asking if you are planing to support this feature. In case that you will not support that I will have to rewrite your Linq provider to be able to do that. | ||||
| Comment by Craig Wilson [ 26/Nov/12 ] | ||||
|
This is the first time it has been added to the list. May I ask why you want to use Linq with a BsonDocument? It's a relatively large overhead for very little benefit. As you can see, there is a relatively simple workaround for this that also happens to be syntactically shorter.
| ||||
| Comment by Teodor Georgiev [ 26/Nov/12 ] | ||||
|
Are you planing to support similar feature? | ||||
| Comment by Robert Stam [ 24/Nov/12 ] | ||||
|
We don't currently support LINQ queries against collections of type MongoCollection<BsonDocument>. LINQ queries are only supported against C# classes that expose their queryable values as public properties (or fields). I've changed the description of this issue to more accurately reflect that fact. |