I am using MongoDB with Spring Boot 2.0.1.RELEASE
. Everything seems to be working fine. I am able to perform CRUD operations properly using MongoRepository. When I use mongodb query in like
@Query(value = "{address.city:?0}")
public List<Hotel> findByCity(String city);
@Query(value = "{address.country:?0}")
public List<Hotel> findByCountry(String country);
When I try to access data using the url localhost:8090/hotels/address/city/Rome
, I get the following error in response
{
"timestamp": "2018-05-04T04:51:43.549+0000",
"status": 500,
"error": "Internal Server Error",
"message": "Invalid JSON input. Position: 9. Character: '.'.",
"path": "/hotels/address/city/rome"
}
and the following log in console:
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.bson.json.JsonParseException: Invalid JSON input. Position: 9. Character: '.'.] with root cause
org.bson.json.JsonParseException: Invalid JSON input. Position: 9. Character: '.'.
I don't know why I am getting Invalid JSON input. Position: 9. Character: '.'.
when I am performing GET
request?
Where am I going wrong?