问题描述:

问题:MongoDB C# driver异常:Truncation resulted in data loss

原因分析:

MongoDB C#驱动在读取数据记录遇到数值类型字段时,如果没有设置允许截断,将抛出TruncationException。

解决方法:

[BsonRepresentation(BsonType.Double, AllowTruncation = true)]
public float cloudpercent { get; set; }

搞定!

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-29
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2022-12-23
相关资源
相似解决方案