c# - 带有文档数组的 MongoDB 建模
问题描述
我正在尝试做这样的事情:
public class Model_Medication
{
public ObjectId _id;
public string name { set; get; }
public List<Medication_Label> labels { set; get; }
}
public class Medication_Label
{
public string ndc { set; get; }
public string strength { set; get; }
public ObjectId pill { set; get; }
}
我收到了这个错误:FormatException: Cannot deserialize a 'List<Medication_Label>' from BsonType 'Document'.
有什么建议或链接可以帮助我继续吗?
解决方案
推荐阅读
- elasticsearch - 根据指示状态变化的事件绘制状态图
- swift - SwiftUI macOS 悬停在按钮更改光标鼠标上
- python - 异常值:join() 参数必须是 str、bytes 或 os.PathLike 对象,而不是“函数”
- airflow - 错误:Gunicorn 大师在 120 秒内没有响应。关闭网络服务器。Airflow-Webserver 服务无法启动
- swift - 使用委托和协议模式发送数据时意外发现 nil
- openlayers - 在 Openlayers 的当前视口之外请求和缓存 WMTS/平铺的 WMS 切片
- javascript - 为输入的每餐创建一个带有复选框的表单
- c# - 更改用户环境变量 WIX 自定义操作 C#
- python - 关于如何解释这个递归求和函数答案的问题?def sum_numbers(n): 返回 n + sum_numbers(n-1) if n else 0
- c# - 如何在 C# 中获取值列表的组合