[CSHARP-2519] AsQueryable Linq Condition and BsonDocument Filter Created: 15/Feb/19  Updated: 25/Jun/20  Resolved: 25/Jun/20

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

Type: Task Priority: Major - P3
Reporter: SUJIL Assignee: Wan Bachtiar
Resolution: Done Votes: 0
Labels: Bug, driver, question, rfw
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

ASP.net Core / WEB API



 Description   

Hi All,

   I have one Model Class its ID element contain BsonDocument  and rest of the properties are normal BsonElement ,i would like to Get the information from the DB with normal Linq Condition and Filter inside the BsonDocument also , Please let me know how can i do that

Eg : 
Var Items = Collection.AsQueryable<Tclass>().Where(p=> p.FirstName="sd" && p.Id.Country=="sd").ToList()

Model :

[BsonElement("ID")]
public BsonDocument Id { get; set; }-- ID Contains / Address / Place /Country etc 

[BsonElement("FirstName")]
public string FirstName{ get; set; }

Thanks 
SUJIL T



 Comments   
Comment by Rachelle Palmer [ 25/Jun/20 ]

Hi there, thank you for reaching out to MongoDB. As this sounds more like a support issue, I wanted to give you some resources to get this question answered more quickly:

  • our MongoDB support portal, located at support.mongodb.com
  • our MongoDB community forums, located here
  • If you are an Atlas customer, there is free support offered 24/7 in the lower right hand corner of the UI.

Thank you!
Rachelle

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