Posts

Showing posts from January 3, 2019

Search in MongoDB with multiple field using $or

Image
0 I have student data in MongoDB and I am using mongoose as orm. I want to search all the students with the search param matching any of the student fields. query = { find: { $or: [ { 'first_name': '/' + req.body.search_text + '/' }, { 'last_name': '/' + req.body.search_text + '/' }, { 'email': '/' + req.body.search_text + '/' }, { 'city': '/' + req.body.search_text + '/' }, ] } } But it's not working as expected. regex mongodb mongoose share | improve this qu...

urlTemplate not found

Image
0 0 I am working with WebTestClient in Spring Boot Reactive app. I use the UriBuilder to include a custom pagination range object written in Kotlin that I've got no visibility of. It works until the documentation point which give the message below: java.lang.IllegalArgumentException: urlTemplate not found. If you are using MockMvc did you use RestDocumentationRequestBuilders to build the request? at org.springframework.util.Assert.notNull(Assert.java:193) at org.springframework.restdocs.request.PathParametersSnippet.extractUrlTemplate(PathParametersSnippet.java:132) at org.springframework.restdocs.request.PathParametersSnippet.extractActualParameters(PathParametersSnippet.java:119) at org.springframework.restdocs.request.AbstractParametersSnippet.verifyParameterDescriptors(AbstractParametersSnippet.java:95) a...