美文网首页
Mongodb 高级搜索规则

Mongodb 高级搜索规则

作者: 时代小召唤 | 来源:发表于2017-05-17 16:52 被阅读0次

    操作符

    $eq 等于
    $lt 大于
    $gt 小于
    $regex 模糊
    $in 包含
    $nin 不包含
    

    使用方法 操作符 + 变量名

    $ltLastModifiedWhen=$date2017-04-29T00:00:00.000Z
    

    数据类型

    $date 日期类型
    $date2017-04-29T00:00:00.000Z
    

    除了日期格式比较特殊,需要用$date开头,其他都可以用字符串来传输

    模糊查询

    http://localhost:8100/api/search/order?$regexcurrectProcessName=服务商
    

    包含/不包含 查询

    http://localhost:8100/api/search/order?$inName=基础,基础2,基础3
    

    相关文章

      网友评论

          本文标题:Mongodb 高级搜索规则

          本文链接:https://www.haomeiwen.com/subject/uvmztxtx.html