运算符
运算符一般用于连接运算数或参数等单个数据项并返回结果。从语法上讲,运算符出现在操作数之前、操作数之后或两个操作数之间均可。
运算符示例
数据筛选(where)
等于
使用 $eq 表示等于,写法如下:
where={"category": {"$eq": "AI"}}
不等于
使用 $ne 表示不等于,写法如下:
where={"status": {"$ne": "deleted"}}
大于
使用 $gt 表示大于,写法如下:
where={"score": {"$gt": 90}}
大于或等于
使用 $gte 表示大于或等于,写法如下:
where={"score": {"$gte": 90}}
小于
使用 $lt 表示小于,写法如下:
where={"score": {"$lt": 50}}
小于或等于
使用 $lte 表示小于或等于,写法如下:
where={"score": {"$lte": 50}}
包含
使用 $in 表示包含,写法如下:
where={"tag": {"$in": ["ml", "python", "ai"]}}