Monday, August 11, 2014

M101J: MongoDB for Java Developers

Homework: Homework 1.2 

 Which of the following are valid JSON documents? Please choose all that apply.

1. {“name”:”Fred Flintstone”;”occupation”:”Miner”;”wife”:”Wilma”} 

2.{“title”:”Star Wars”, “quotes”:[“Use The Force”,”These are not the Droids you are looking for”],”director”:”George Lucas”}

3.{}

4.{“city”:”New York”, “population”, 7999034, boros:{“queens”, “manhattan”, “staten island”, “the bronx”, “brooklyn”}}

5.{“a”:1, “b”:{“b”:1, “c”:”foo”, “d”:”bar”, “e”:[1,2,4]}} 

 

Answer : 2,3,5

Invalid Json

1. {“name”:”Fred Flintstone”;”occupation”:”Miner”;”wife”:”Wilma”}  

4. {“city”:”New York”, “population”, 7999034, boros:{“queens”, “manhattan”, “staten island”, “the bronx”, “brooklyn”}}

No comments:

Post a Comment