您可能听说过JSON,但像大多数人一样,您可能不知道它的含义。好吧,它代表JavaScript Object Notation。JSON最酷的地方在于它既是人类可读的又是机器可读的,这是许多语言所缺乏的。不仅如此,JSON是一门独立的语言,这让许多人感到惊讶,因为JavaScript是其名称的一部分。此外,它不是传统的编程语言,更像是一种开放的标准数据格式。
此外,这种语言是用于各种工具和应用程序的标准API ,尤其是在 Web 上。(API)此外,它是 XML 的重要替代品之一。
什么是 JSON?
JSON是一种开放的标准文件和数据交换格式,它使用人类可读的文本来存储和传输数据对象。它有各种各样的应用程序,可以作为AJAX系统中XML的替代品。
好的,所以JSON(JSON)有两种表示数据的方式,我们现在将讨论它们以供您理解。
- 数组(Array)——根据我们的理解,我们通过左 ([) 和右 (]) 括号定义一个数组。逗号分隔括号内的每个项目。此外,您还可以将其视为值的有序集合。
- 对象(Object)——我们这里有一个键值或名称值对的集合。现在,当涉及到定义一个对象时,它必须在左 ({) 和右 (}) 大括号内完成。大括号内的每个名称-值对都必须以名称开头,后跟冒号,最后是值。逗号必须始终分隔每个名称-值对。
什么是 JSON 文档数据库?
当涉及到JSON时,有一种称为文档数据库的东西,但大多数人不会知道它。但是,因为我们刚刚解释了JSON是什么,所以我们只讨论文档数据库才有意义。
您会看到,JSON文档数据库是一种非关系型数据库,创建它是为了将数据存储和查询为JSON文档。不是跨多个表对信息进行规范化,而是每个表都具有类似于关系数据库的独特且固定的结构。
令人印象深刻的事情之一是JSON文档数据库也使用开发人员在其应用程序代码中使用的相同文档格式。这使开发人员可以更轻松地随时查询数据。
JSON 代码示例
JSON字符串示例:
{
"firstname": "Vamien",
"lastname": "McKalin",
“occupation”: “Technical Writer”
}
JSON 编号示例:
{
"id": 1,
"age": 56,
"bornyear": 1965,
"date": 6,
"month": 9,
"weight" : 99.9
}
以下是一些有用的在线 JSON 工具,可帮助您入门。
阅读(Read): 如何打开 JSON 文件(How to open a JSON file)。
享受(Enjoy)学习JSON的乐趣,请务必在评论中联系我们。
What is the JSON data format and JSON document database?
Chances are you have heard of JSON, but like most people, you may not know what it means. Well, it stands for JavaScript Object Notation. The cool thing about JSON is that it is both human and machine-readable, which many languages lack. Not only that, JSON is an independent language, which is a surprise to many seeing as JavaScript is part of its name. Furthermore, it is not a traditional programming language and more of an open standard data format.
Additionally, this language is a standard API used in a variety of tools and applications, especially on the web. Furthermore, it is one of the significant alternatives to XML.
What is JSON?
JSON is an open standard file & data interchange format that uses human-readable text to store and transmit data objects. It has a diverse range of applications and can serve as a replacement for XML in AJAX systems.
OK, so there are two ways that JSON represents data, and we’re going to discuss them right now for your understanding.
- Array – From our understanding, we define an Array by the left ([) and right (]) brackets. A comma separates every item within the brackets. Furthermore, you can also view this as an ordered collection of values.
- Object – What we have here is a collection of key-value or name-value pairs. Now, when it comes down to defining an object, it must be done within the left ({) and right (}) braces. Every name-value pair inside the braces must begin with the name, followed up by a colon, and finally, the value. A comma must always separate each name-value pair.
What is a JSON Document Database?
There is something called document database when it comes down to JSON, but most folks won’t know of it. However, because we have just explained what JSON is, it only makes sense for us to discuss document databases.
You see, a JSON document database is a form of nonrelational database that was created to store and query data as JSON documents. Instead of normalizing information across several tables, each has a unique and fixed structure similar to a relational database.
One of the impressive things about this is the fact that JSON document databases also use the same document formats used by developers in their application code. This makes it easier for developers to query data whenever they want to.
JSON code examples
JSON String Example:
{
"firstname": "Vamien",
"lastname": "McKalin",
“occupation”: “Technical Writer”
}
JSON Number Example:
{
"id": 1,
"age": 56,
"bornyear": 1965,
"date": 6,
"month": 9,
"weight" : 99.9
}
Here are some useful online JSON Tools to help you get started.
Read: How to open a JSON file.
Enjoy learning JSON, and be sure to hit us up in the comments.