JSON AND BSON

JSON

JavaScript Object Notation (JSON) is an open, human and machine-readable standard that facilitates data interchange, and along with XML is the main format for data interchange used on the modern web. JSON supports all the basic data types you’d expect: numbers, strings, and boolean values, as well as arrays and hashes. Document databases such as MongoDB use JSON documents in order to store records, just as tables and rows store records in a relational database. Here is an example of a JSON document:

{
"_id" : 1,
"name" : { "first" : "John", "last" : "Backus" },
"contribs" : [ "Fortran", "ALGOL", "Backus-Naur Form", "FP" ],
"awards" : [
           {
             "award" : "W.W. McDowell Award",
             "year" : 1967,
             "by" : "IEEE Computer Society"
           },
           { "award" : "Draper Prize",
             "year" : 1993,
             "by" : "National Academy of Engineering"
           }
]
}

A JSON database returns query results that can be easily parsed, with little or no transformation, directly by JavaScript and most popular programming languages – reducing the amount of logic you need to build into your application layer.

Binary JSON (BSON)

MongoDB represents JSON documents in binary-encoded format called BSON behind the scenes. BSON extends the JSON model to provide additional data types and to be efficient for encoding and decoding within different languages.

MongoDB, BSON, and JSON

The MongoDB BSON implementation is lightweight, fast and highly traversable. Like JSON, MongoDB‘s BSON implementation supports embedding objects and arrays within other objects and arrays – MongoDB can even "reach inside" BSON objects to build indexes and match objects against query expressions on both top-level and nested BSON keys. This means that MongoDB gives users the ease of use and flexibility of JSON documents together with the speed and richness of a lightweight binary format. Read our MongoDB overview to learn more about these features.

Free Whitepaper: MongoDB Architecture Guide

In this introductory technical paper, you‘ll learn:

  • The architecture of MongoDB.
  • How MongoDB builds and runs applications today.
  • MongoDB‘s document data model, query model, data management, consistency, durability, availability and performance.
时间: 2024-08-05 19:02:44

JSON AND BSON的相关文章

ASP.NET Web API 2.1支持Binary JSON(Bson)

ASP.NET Web API 2.1内建支持XML.Json.Bson.form-urlencoded的MiME type,今天重点介绍下Bson. BSON是由10gen开发的一个数据格式,目前主要用于MongoDB中,是MongoDB的数据存储格式.BSON基于JSON格式,选择JSON进行改造的原因主要是JSON的通用性及JSON的schemaless的特性. BSON主要会实现以下三点目标: 1.更快的遍历速度 对JSON格式来说,太大的JSON结构会导致数据遍历非常慢.在JSON中,

kbmmw 中XML 操作入门(跨平台,而且可以与JSON,YAML,BSON 直接互相转换)

delphi 很早以前就自带了xml 的操作,最新版里面有三种XML 解释器,一种是MSXML,看名字就知道 这个是微软自带的,这个据delphi 官方称是速度是最快的,但是只能在windows 上使用.另外两个是 OmniXML, ADOM, 这两个都是跨平台的.但是速度比MSXML 慢点.在delphi 10.2 里面,WINDOWS 应用默认使用MSXML, linux 应用默认使用OmniXML. 当然也可以通过强行改变 今天我们讲一下如何使用kbmmw 内置的XML 解释器处理XML

json转换为go类文件,js脚本,nodejs执行

js写的代码生成脚本,json生成对应的go type对象 作json转换用 js脚本无甚何依赖,可以直接运行 执行前,按需更改文件 示例 var topname="Data"; var defaulttype="string"; var bson=true; //对应 mongodb var json=true; //http response var scheme=false; //http request->scheme var jdata={ &quo

MongoDB 将Json数据直接写入MongoDB的方法

Json转Bson MongoDB中是以Bson数据格式进行存储的,Json字符串没有办法直接写入MongoDB 可以将Json字符串转换成DBObject或者Document,然后写入MongoDB 1.将Json字符转换成com.mongodb.DBObject(准确的说是BasicDBObject) scala版本 import com.mongodb.DBObject import com.mongodb.casbah.{MongoClient, MongoCollection} imp

数据库介绍与分类

目录 数据库介绍与分类... 1 1.1 数据库介绍... 2 1.1.1什么是数据库... 2 1.2数据库的种类... 2 1.2.1关系型数据库介绍... 2 1.2.2非关系型数据库介绍... 3 1.3 常用关系型数据库产品介绍... 4 1.3.1 Oracle数据库... 4 1.3.2 MySQL数据库... 5 1.3.3 MariaDB数据库... 5 1.3.4 SqlServer数据库... 6 1.3.5 Access数据库... 6 1.3.6 其他不常用数据库...

GitHub上整理的一些工具,求补充

http://segmentfault.com/q/1010000002404545 技术站点 Hacker News:非常棒的针对编程的链接聚合网站 Programming reddit:同上 MSDN:微软相关的官方技术集中地,主要是文档类 infoq:企业级应用,关注软件开发领域 OSChina:开源技术社区,开源方面做的不错哦 cnblogs,51cto,csdn:常见的技术社区,各有专长 stackoverflow:IT技术问答网站 GitHub:全球最大的源代码管理平台,很多知名开源

mongodb入门

一.mongodb mongodb是一种开源的,免费的非关系型数据库(NoSql).它具有速度快使用简单,数据格式与json对应,等特点,最大的特点在于所有的数据持久操作都无需开发人员手动编写SQL语句,直接调用方法就可以轻松的实现对数据库的操作.mongodb下载地址为:http://www.mongodb.org/downloads . 安装如下: 在下载页面选择适合的版本,这里使用的版本是windows版本mongodb-win32-i386-2.4.12.将该压缩文件解压到C:\mong

开源大数据处理系统/工具大全

本文一共分为上下两部分.我们将针对大数据开源工具不同的用处来进行分类,并且附上了官网和部分下载链接,希望能给做大数据的朋友做个参考.下面是第一部分. 查询引擎 一.Phoenix 贡献者::Salesforce 简介:这是一个Java中间层,可以让开发者在Apache HBase上执行SQL查询.Phoenix完全使用Java编写,代码位于GitHub上,并且提供了一个客户端可嵌入的JDBC驱动. Phoenix查询引擎会将SQL查询转换为一个或多个HBase scan,并编排执行以生成标准的J

MongoDB---前世今生

MongoDB的官方文档基本是how to do的介绍,而关于how it worked却少之又少,本人也刚买了<MongoDB TheDefinitive Guide>的影印版,还没来得及看,本文原作者将其书中一些关于MongoDB内部现实方面的一些知识介绍如下,值得一看. 今天下载了<MongoDB The Definitive Guide>电子版,浏览了里面的内容,还是挺丰富的.是官网文档实际应用方面的一个补充.和官方文档类似,介绍MongoDB的内部原理是少之又少,只有在附