Skip to main content

compare

Function compare 

Source
pub fn compare(a: &Value, b: &Value) -> Ordering
Expand description

Mongo BSON 序比较(Ordering::Less/Greater/Equal)。

数字间按数值比较(整型/浮点/扩展 Long 统一,1 与 1.0 相等); 字符串按字节序;文档逐键(键名 → 键值)比较,前缀相等时短者小;数组逐元素、前缀相等时短者小。