Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kseo/bson_codec

BSON serialization for Dart
https://github.com/kseo/bson_codec

Last synced: 26 days ago
JSON representation

BSON serialization for Dart

Awesome Lists containing this project

README

        

# bson_codec

[![Build Status](https://travis-ci.org/kseo/bson_codec.svg?branch=master)](https://travis-ci.org/kseo/bson_codec)

This package offers Dart programs a flexible serializer and deserializer
for BSON documents.

## Highlights

* Standard `Codec`/`Converter` interface, as established by the
standard 'dart:convert' package.
* Best effort type mapping when serializing/deserializing values.

## Examples

```
import 'package:bson_codec/bson_codec.dart';

main() {
final doc = {
'_id': 5,
'a': [2, 3, 5]
};
List bytes = BSON.encode(doc);
final root = BSON.decode(bytes);
print(doc['a'][2]); // 5
}
```

### TODO

`JavaScript code w/ scope` and `decimal128` are not supported yet.