Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
com.mongodb.util.JSONParseException:_Json_Regex_Mongodb_Mongodb Query_Regex Group - Fatal编程技术网

com.mongodb.util.JSONParseException:

com.mongodb.util.JSONParseException:,json,regex,mongodb,mongodb-query,regex-group,Json,Regex,Mongodb,Mongodb Query,Regex Group,我在以下代码中遇到此异常: { 'items.name' : {$regex:^"_param_0"$,$options:'i' }} 使用的方法是: @Query("{ 'items.name' : {$regex:^?0$,$options:'i' }}") public List<MenuEntity> getMenuByitemNameExact(String name); @Query(“{'items.name':{$regex:^?0$,$options:'i'}”

我在以下代码中遇到此异常:

{ 'items.name' : {$regex:^"_param_0"$,$options:'i' }}
使用的方法是:

@Query("{ 'items.name' : {$regex:^?0$,$options:'i' }}")
public List<MenuEntity> getMenuByitemNameExact(String name);
@Query(“{'items.name':{$regex:^?0$,$options:'i'}”)
公共列表getMenuByitemNameExact(字符串名称);

修改方法如下

@Query(value = "{'items.name': {$regex : ?0, $options: 'i'}}")
List<MenuEntity> findByitemNameRegex(String name);
@Query(value=“{'items.name':{$regex:?0,$options:'i'}”)
列出findByitemNameRegex(字符串名称);