账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    根据List里面的值,查询模糊查询mongodb,最好用springdata mongodb
    27
    0
    1. 现在条件是一个List,如 type["sh","th"] //不是数据库type里面的全值,只有一个前缀
    2. 根据这个查询下面数据库,type里面有sh和th为前缀的,整个document
    3. 结果应该是1,2,4条record(document)都应该被查出来
    4. 怎么实现,最好用springdata mongdb,其它java方式也行

    比如数据库有3条record如下:

    {
        "_id": "5bcfe3367f0xxxxx02",
        "type": [
            "sh-adidas",
            "th-NB"
        ],
        "status": "active",
        "lastUpdateDate": "2018-10-25T17:27:41+08:00"
    }
    {
        "_id": "5bcfe3367f0xxxxx02",
        "type": [
            "bj-nike",
            "sh-adidas"
        ],
        "status": "active",
        "lastUpdateDate": "2018-10-25T17:27:41+08:00"
    }
    {
        "_id": "5bcfe3367f0xxxxx02",
        "type": [
            "bj-nike"
        ],
        "status": "active",
        "lastUpdateDate": "2018-10-25T17:27:41+08:00"
    }
    {
        "_id": "5bcfe3367f0xxxxx02",
        "type": [
            "bj-nike",
            "sh-adidas",
            "th-NB",
            "th-vans"
        ],
        "status": "active",
        "lastUpdateDate": "2018-10-25T17:27:41+08:00"
    }
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 更俗 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部