bson

Bson library for Delphi?

别说谁变了你拦得住时间么 提交于 2019-12-03 07:22:47
Can someone suggest a complete Bson library for Delphi ? I'm trying to use http://code.google.com/p/pebongo/source/browse/trunk/_bson.pas from http://bsonspec.org , but there are some structures that aren't supported. Or maybe I'm not using it correctly, like this class doesn't have documentation I can not find the correct usage for it. I want to create a list of items, this items are my serializable objects. But how to create a list and put item on a "list" ? I've created a BSON implementation for Delphi before, heavily based on the existing Variant type in Delphi (and its TVarType). It also

Is a binary JSON javascript library available for browsers?

回眸只為那壹抹淺笑 提交于 2019-12-03 06:38:44
问题 In order for efficient server side parsing I am looking into a BSON solution directly for the browser javascript environment. The idea is to utilize the entire ASCII space by means of binary websockets. Any suggestions? (Any nodejs suggestions are welcome as well) See also: http://bsonspec.org/ 回答1: This might be incomplete but the goal of the project line up with what you want: https://github.com/muhmi/javascript-bson It doesn't look like that encodes directly to typed arrays which would be

Which one is lighter, JSON or BSON?

為{幸葍}努か 提交于 2019-12-03 05:35:52
问题 I have written code to serialize objects to JSON and BSON. According to my output, the BSON produced is greater in size than the JSON. Is this expected? From my code for Bson.class (using Jackson and bson4jackson) private ByteArrayOutputStream baos = new ByteArrayOutputStream(); private BsonFactory fac = new BsonFactory(); private ObjectMapper mapper = new ObjectMapper(fac); public Bson(Object obj) throws JsonGenerationException, JsonMappingException, IOException { mapper.writeValue(baos, obj

How to convert BSON to JSON with human-readable date format

梦想与她 提交于 2019-12-03 04:33:45
I would like to transform a BSON dump of MongoDB to JSON. To do that, I'm using the bsondump tool provided with Mongo, but I get an output like : { "_id" : ObjectId( "5316d194b34f6a0c8776e187" ), "begin_date" : Date( 1394004372038 ), "foo" : "bar" } { "_id" : ObjectId( "5316d198b34f6a0c8776e188" ), "begin_date" : Date( 1394004407696 ), "foo" : "bar" } Can anyone tell me how to get the dates appear in a human readable format (e.g. hh:mm:ss dd/mm/yyyy ) ? Edit It looks like that a more recent version of mongodump outputs dates as: { "_id" : ObjectId( "5316d194b34f6a0c8776e187" ), "begin_date" :

What is BSON and exactly how is it different from JSON?

蓝咒 提交于 2019-12-03 00:14:14
问题 I am just starting out with MongoDB and one of the things that I have noticed is that it uses BSON to store data internally. However the documentation is not exactly clear on what BSON is and how it is used in MongoDB. Can someone explain it to me, please? 回答1: BSON is the binary encoding of JSON-like documents that MongoDB uses when storing documents in collections. It adds support for data types like Date and binary that aren't supported in JSON. In practice, you don't have to know much

Is there a way to store python objects directly in mongoDB without serializing them

怎甘沉沦 提交于 2019-12-02 23:33:07
I have read somewhere that you can store python objects (more specifically dictionaries) as binaries in MongoDB by using BSON. However right now I cannot find any any documentation related to this. Would anyone know how exactly this can be done? There isn't a way to store an object in a file (database) without serializing it. If the data needs to move from one process to another process or to another server, it will need to be serialized in some form to be transmitted. Since you're asking about MongoDB, the data will absolutely be serialized in some form in order to be stored in the MongoDB

【本人秃顶程序员】MongoDB是个好东西,希望你也会

此生再无相见时 提交于 2019-12-02 22:32:38
←←←←←←←←←←←← 快!点关注 1、MongoDB是什么? MongoDB是一款为web应用程序和互联网基础设施设计的数据库管理系统。没错MongoDB就是数据库,是NoSQL类型的数据库 2、为什么要用MongoDB? (1)MongoDB提出的是文档、集合的概念,使用BSON(类JSON)作为其数据模型结构,其结构是面向对象的而不是二维表,存储一个用户在MongoDB中是这样子的。 { username:'123', password:'123' } 使用这样的数据模型,使得MongoDB能在生产环境中提供高读写的能力,吞吐量较于mysql等SQL数据库大大增强。 (2)易伸缩,自动故障转移。易伸缩指的是提供了分片能力,能对数据集进行分片,数据的存储压力分摊给多台服务器。自动故障转移是副本集的概念,MongoDB能检测主节点是否存活,当失活时能自动提升从节点为主节点,达到故障转移。 (3)数据模型因为是面向对象的,所以可以表示丰富的、有层级的数据结构,比如博客系统中能把“评论”直接怼到“文章“的文档中,而不必像myqsl一样创建三张表来描述这样的关系。 3、主要特性 (1)文档数据类型 SQL类型的数据库是正规化的,可以通过主键或者外键的约束保证数据的完整性与唯一性,所以SQL类型的数据库常用于对数据完整性较高的系统。MongoDB在这一方面是不如SQL类型的数据库

Which one is lighter, JSON or BSON?

独自空忆成欢 提交于 2019-12-02 20:07:41
I have written code to serialize objects to JSON and BSON. According to my output, the BSON produced is greater in size than the JSON. Is this expected? From my code for Bson.class (using Jackson and bson4jackson) private ByteArrayOutputStream baos = new ByteArrayOutputStream(); private BsonFactory fac = new BsonFactory(); private ObjectMapper mapper = new ObjectMapper(fac); public Bson(Object obj) throws JsonGenerationException, JsonMappingException, IOException { mapper.writeValue(baos, obj); } public int size() { return baos.size(); } public String toString() { byte[] bytes = baos

Is a binary JSON javascript library available for browsers?

邮差的信 提交于 2019-12-02 19:12:39
In order for efficient server side parsing I am looking into a BSON solution directly for the browser javascript environment. The idea is to utilize the entire ASCII space by means of binary websockets. Any suggestions? (Any nodejs suggestions are welcome as well) See also: http://bsonspec.org/ This might be incomplete but the goal of the project line up with what you want: https://github.com/muhmi/javascript-bson It doesn't look like that encodes directly to typed arrays which would be the most useful for sending over WebSocket. jriggins For what it's worth, it appears that the MongoDB team

What is BSON and exactly how is it different from JSON?

一个人想着一个人 提交于 2019-12-02 13:58:19
I am just starting out with MongoDB and one of the things that I have noticed is that it uses BSON to store data internally. However the documentation is not exactly clear on what BSON is and how it is used in MongoDB. Can someone explain it to me, please? BSON is the binary encoding of JSON-like documents that MongoDB uses when storing documents in collections. It adds support for data types like Date and binary that aren't supported in JSON. In practice, you don't have to know much about BSON when working with MongoDB, you just need to use the native types of your language and the supplied