Just change it in application.conf
mongodb.uri = "mongodb://localhost/persons"
sbt run
Cities controller uses a model, showing how simple it is in Play to parse json data from the clients
curl -H "Content-Type: application/json" -X POST -d '{"name":"london","population": 8539000}' http://localhost:9000/cities/
curl -X "POST" http://localhost:9000/cities/add\?name\=Paris&population\=2244000
curl -H "Content-Type: application/json" -X POST -d '[{"name":"tokyo","population": 13350000}, {"name":"osaka","population": 2665000}]' http://localhost:9000/cities/bulk
curl http://localhost:9000/cities?name=Paris
curl -H "Content-Type: application/json" -X POST -d '{"name":"london"}' http://localhost:9000/cities/
curl -H "Content-Type: application/json" -X POST -d '{"name":"london", "population": "x"}' http://localhost:9000/cities/
curl -H "Content-Type: application/json" -X POST -d '[{"name":"unknown"}]' http://localhost:9000/cities/bulk
Person controller does not use a model, following the Coast to coast Json approach
curl -H "Content-Type: application/json" -X POST -d '{"name":"jason","age": 12}' http://localhost:9000/persons/
curl -X "POST" http://localhost:9000/persons/add\?name\=Jason%20Voorhees\&age\=31
curl -H "Content-Type: application/json" -X POST -d '[{"name":"jacob","age": 35}, {"name":"rohit","age": 27}, {"name":"federico","age": 31}, {"name":"oliver","age": 33}]' http://localhost:9000/persons/bulk
Test invalid formats
curl -H "Content-Type: application/json" -X POST -d '[{"name": "pepe"}]' http://localhost:9000/persons/bulk
curl http://localhost:9000/persons?name=jason