我正在尝试将数字 1477958757748.9697 转换为 mongo-shell 中的 long 。NumberLong 函数抛出错误:
> NumberLong(1477958757748.9697);
2017-06-03T08:52:56.306-0400 E QUERY [thread1] Error: number
passed to NumberLong must be representable as an int64_t :
@(shell):1:1
>
NumberLong 有替代品吗?例如 NumberInt 确实适用于整数:
> NumberInt(12.6);
NumberInt(12)
>
你怎么能在Mongo中做到这一点?