[FAQ] Cannot use object of type MongoInt64 as array

 

此类情况出现在 需要使用字符串/数组,实际却使用了对象。

解决方式是调试数据,对数据类型进行转换即可。

 

MongoInt64 对象提供 __toString 方法,那么可以强转成 64 位 integer 的字符串表示形式。

 

Link:https://www.cnblogs.com/farwish/p/14183161.html

MongoInt64::__toString — 返回该 64 位 integer 的字符串表示形式。

posted on 2020-12-24 12:42  ercom  阅读(116)  评论(0编辑  收藏  举报