MongoDB

相关代码:

if args.get('title'):
    filters['title'] = {'$regex': args['title'], '$options': 'i'}

if args.get('unitCode'):
    filters['unit_code'] = {'$regex': args['unitCode'], '$options': 'i'}

其中的$regex表示搜索时,用正则搜索

-》此处含义是:去搜索titleunitCode两个字段,且i表示不区分大小写

results matching ""

    No results matching ""