Product SiteDocumentation Site

2.5. JSON Objects

Objects are unordered sets of key/value pairs. A key is any JSON string as described above. A value is any JSON building block.
According to the JSON RFC, keys (the strings) should be unique within the same object -- and JSONiq does consider them unique.
You can see in the following examples that values can be also nested objects or arrays.
{
  "_id" : "511C7C5C9A277C22D138802D",
  "question_id" : 4419499,
  "last_edit_date" : "2012-12-17T00:02:31",
  "creation_date" : "2010-12-11T23:15:19",
  "last_activity_date" : "2012-12-17T00:02:31",
  "score" : 15,
  "accepted_answer_id" : 4421601,
  "title" : "MySQL and NoSQL: Help me to choose the right o
ne",
  "tags" : [ "php", "mysql", "nosql", "cassandra" ],
  "view_count" : 3972,
  "owner" : {
    "user_id" : 279538,
    "display_name" : "cedivad",
    "reputation" : 430,
    "user_type" : "registered",
    "profile_image" : "http://www.gravatar.com/avatar/b77fa
dd2ba791134ac40a9c184be1eda?d=identicon&r=PG",
    "link" : "http://stackoverflow.com/users/279538/cedivad
",
    "accept_rate" : 74
  },
  "link" : "http://stackoverflow.com/questions/4419499/mysq
l-and-nosql-help-me-to-choose-the-right-one",
  "is_answered" : true
}
In the NoSQL world, top-level JSON objects are often referred to as JSON documents.