JsonParseException: Invalid JSON input. Position: 9. Character: '.' JsonParseException: Invalid JSON input. Position: 9. Character: '.' mongodb mongodb

JsonParseException: Invalid JSON input. Position: 9. Character: '.'


Missing quotes; @Query(value = "{'address.country':?0}")

– Neil Lunn

That worked for me too.


It can arise if you are missing quotes or it can be due to unparsed string passed to MongoDB. Try using parsed string like \"appname\":1. This is an example of projection.