You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to filter entities by id list.
It looks like this as request param: filter=id in ['8227848e-9a01-4394-a1e7-1973199c327d', '634c41a4-df95-4669-91e0-d2c49fea5ccd']
...also it occurs with filter=id not in []
And when a request is received, spring-data-mongodb throws an exception:
Spoiler warning
DEBUG 87142 --- [nio-8081-exec-7] o.s.data.mongodb.core.MongoTemplate : find using query: { "$expr" : { "$and" : [{ "$isArray" : ["8227848e-9a01-4394-a1e7-1973199c327d", "634c41a4-df95-4669-91e0-d2c49fea5ccd"]}, { "$in" : ["$id", ["8227848e-9a01-4394-a1e7-1973199c327d", "634c41a4-df95-4669-91e0-d2c49fea5ccd"]]}]}} fields: Document{{}}
ERROR 87142 --- [nio-8081-exec-7] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.data.mongodb.UncategorizedMongoDbException: Command failed with error 16020 (Location16020): 'Expression $isArray takes exactly 1 arguments. 2 were passed in.' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "Expression $isArray takes exactly 1 arguments. 2 were passed in.", "code": 16020, "codeName": "Location16020"}] with root cause
com.mongodb.MongoQueryException: Command failed with error 16020 (Location16020): 'Expression $isArray takes exactly 1 arguments. 2 were passed in.' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "Expression $isArray takes exactly 1 arguments. 2 were passed in.", "code": 16020, "codeName": "Location16020"}
at com.mongodb.internal.operation.FindOperation.lambda$execute$1(FindOperation.java:336) ~[mongodb-driver-core-4.8.2.jar:na]
at com.mongodb.internal.operation.OperationHelper.lambda$withSourceAndConnection$0(OperationHelper.java:356) ~[mongodb-driver-core-4.8.2.jar:na]
at com.mongodb.internal.operation.OperationHelper.withSuppliedResource(OperationHelper.java:381) ~[mongodb-driver-core-4.8.2.jar:na]
at com.mongodb.internal.operation.OperationHelper.lambda$withSourceAndConnection$1(OperationHelper.java:355) ~[mongodb-driver-core-4.8.2.jar:na]
at com.mongodb.internal.operation.OperationHelper.withSuppliedResource(OperationHelper.java:381) ~[mongodb-driver-core-4.8.2.jar:na]
at com.mongodb.internal.operation.OperationHelper.withSourceAndConnection(OperationHelper.java:354) ~[mongodb-driver-core-4.8.2.jar:na]
at com.mongodb.internal.operation.FindOperation.lambda$execute$2(FindOperation.java:329) ~[mongodb-driver-core-4.8.2.jar:na]
at com.mongodb.internal.async.function.RetryingSyncSupplier.get(RetryingSyncSupplier.java:67) ~[mongodb-driver-core-4.8.2.jar:na]
at com.mongodb.internal.operation.FindOperation.execute(FindOperation.java:340) ~[mongodb-driver-core-4.8.2.jar:na]
at com.mongodb.internal.operation.FindOperation.execute(FindOperation.java:79) ~[mongodb-driver-core-4.8.2.jar:na]
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:191) ~[mongodb-driver-sync-4.8.2.jar:na]
at com.mongodb.client.internal.MongoIterableImpl.execute(MongoIterableImpl.java:133) ~[mongodb-driver-sync-4.8.2.jar:na]
at com.mongodb.client.internal.MongoIterableImpl.iterator(MongoIterableImpl.java:90) ~[mongodb-driver-sync-4.8.2.jar:na]
at org.springframework.data.mongodb.core.MongoTemplate.executeFindMultiInternal(MongoTemplate.java:2728) ~[spring-data-mongodb-4.0.1.jar:4.0.1]
at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:2445) ~[spring-data-mongodb-4.0.1.jar:4.0.1]
at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:2427) ~[spring-data-mongodb-4.0.1.jar:4.0.1]
at org.springframework.data.mongodb.core.MongoTemplate.find(MongoTemplate.java:833) ~[spring-data-mongodb-4.0.1.jar:4.0.1]
at org.springframework.data.mongodb.core.MongoTemplate.find(MongoTemplate.java:823) ~[spring-data-mongodb-4.0.1.jar:4.0.1]
at org.keelfy.storydale.api.service.impl.LanguageServiceImpl.search(LanguageServiceImpl.java:37) ~[classes/:na]
at org.keelfy.storydale.api.controller.impl.LanguageControllerImpl.search(LanguageControllerImpl.java:29) ~[classes/:na]
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:578) ~[na:na]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) ~[spring-aop-6.0.4.jar:6.0.4]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196) ~[spring-aop-6.0.4.jar:6.0.4]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-6.0.4.jar:6.0.4]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:752) ~[spring-aop-6.0.4.jar:6.0.4]
at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:134) ~[spring-context-6.0.4.jar:6.0.4]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) ~[spring-aop-6.0.4.jar:6.0.4]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:752) ~[spring-aop-6.0.4.jar:6.0.4]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:703) ~[spring-aop-6.0.4.jar:6.0.4]
at org.keelfy.storydale.api.controller.impl.LanguageControllerImpl$$SpringCGLIB$$0.search(<generated>) ~[classes/:na]
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:578) ~[na:na]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:207) ~[spring-web-6.0.4.jar:6.0.4]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:152) ~[spring-web-6.0.4.jar:6.0.4]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-6.0.4.jar:6.0.4]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:884) ~[spring-webmvc-6.0.4.jar:6.0.4]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) ~[spring-webmvc-6.0.4.jar:6.0.4]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-6.0.4.jar:6.0.4]
Also here is the code that executes mongoOperations.find:
I'm trying to filter entities by id list.
It looks like this as request param:
filter=id in ['8227848e-9a01-4394-a1e7-1973199c327d', '634c41a4-df95-4669-91e0-d2c49fea5ccd']
...also it occurs with
filter=id not in []
And when a request is received, spring-data-mongodb throws an exception:
Spoiler warning
Also here is the code that executes
mongoOperations.find
:The text was updated successfully, but these errors were encountered: