Q: Querying mongodb with jersey I have a small database on mongodb. I am using RESTful service to read the data from the database. This is done with the help of jersey.
Now the problem is that when i try to access the whole database i can do it without any problem. I get a Json Array with many objects. The code is as follows:
String httpsAdd = "https://api.mongolab.com/api/1/databases/db-name/collections/collection?apiKey=someKey";
Client client = ClientBuilder.newBuilder().sslContext(sslContextCA).build();
Response response = client.target(httpsAdd).request().get();
System.out.println(response.getStatus());
System.out.println(response.readEntity(String.class));

my console shows something like this

[ { "_id" : { "$oid" : "55929085a"} , "User" :
  "ABC" , "Departure" : "QWE" , "Destination" : "RTY" ,
  "Time" : "12:45"} , { "_id" : { "$oid" : "55930ef7"} ,
  "User" : "DEF" , "Departure" : "Nekala" , "Destination" :
  "Koilliskeskus" , "Time" : "20:00"}]

But if i want to query the same database for a specific entry i can not do that. The string i use for querying the database is:
String httpsAdd = "https://api.mongolab.com/api/1/databases/db-name/collections/collection?q={Source: 'Hervanta'}&apiKey=someKey";

I have input the same url in an Advance Rest client and i am able to get all the objects with the source as hervanta so in a way i have verified that the syntax of my query is fine. Java throws me an error that

Caused by: java.lang.IllegalArgumentException: The template variable
  'Source' has no value

I am not sure if i am missing something very obvious or subtle.
Any help would be appreciated.
