I have a document in mongodb that is structured similar to this:
{
\"_id\": \"abcdef01234\",
\"Name\": \"Product A\",
\"Dimensions\": [
{
\"Heigh
Try this:
public class Product
{
[BsonId]
public ObjectId Id { get; set; }
public string Name{ get; set; }
public List Dimensions{ get; set; }
}
public class DimensionDoc
{
public int Height { get; set; }
public int Width { get; set; }
}
Product product = srv["db"]["products"].FindOneByIdAs(ObjectId.Parse("abcdef01234"));
product.Dimensions will now contain the List<> you need.