2
对象的字段数组值如果我有这样一个类:查询MongoDB中
public class Car {
public string Model { get; set; }
public List<string> Types { get; set; }
}
做:
Car _car = new Car();
_car.Model = "1992";
List<string> _types = new List<string>() { "New", "Old" };
_car.Types = _types
和保存这些种在MongoDB中的对象,我怎么得到所有汽车在C#MongoDB中有type == "New"
?我需要查询Car.Type == "New"
我要去上课并查看它的"Types"
数组,并在数组中找到匹配的对象并返回整个类。