尝试从数据库(Mongo DB)中删除值时出现Unable to determine the serialization information for the expression: (PlaceManager pm) => pm.FreePlaces.get_Item(index)
错误。
这是我的代码:
var result = _placeManager.Update(Query.EQ("_id", 0),
Update<PlaceManager>.Pull(pm => pm.FreePlaces[index], placeId));
这里是PlaceManager
课程:
public class PlaceManager
{
[BsonId]
public int Id { get; set; }
public int CurrentSize { get; set; }
public Dictionary<int, List<int>> FreePlaces { get; set; }
}