提交 c0bad53f 编写于 作者: C chenruilong

docs: update jql-operator-example.md

上级 0b8b321b
......@@ -546,17 +546,17 @@ db.collection('test').field('subtract(date, 24 * 60 * 60 * 1000) as dateDifferen
{ _id: 4, value: -45.34 }
```
截断 `value` 到小数点后第一位的信息:
截断 `value` 为整数的信息:
```javascript
db.collection('test').field('trunc(value, 1) as truncatedValue').get()
db.collection('test').field('trunc(value) as truncatedValue').get()
```
执行结果:
```javascript
{ "_id" : 1, "truncatedValue" : 19.2 }
{ "_id" : 2, "truncatedValue" : 28.7 }
{ "_id" : 3, "truncatedValue" : 34.3 }
{ "_id" : 4, "truncatedValue" : -45.3 }
{ "_id" : 1, "truncatedValue" : 19 }
{ "_id" : 2, "truncatedValue" : 28 }
{ "_id" : 3, "truncatedValue" : 34 }
{ "_id" : 4, "truncatedValue" : -45 }
```
### 数组运算方法
#### arrayElemAt
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册