Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/kseo/bson_codec
- Owner: kseo
- License: bsd-3-clause
- Created: 2016-10-02T04:05:14.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-14T16:12:24.000Z (about 8 years ago)
- Last Synced: 2023-08-20T21:29:18.350Z (about 1 year ago)
- Language: Dart
- Homepage: https://pub.dartlang.org/packages/bson_codec
- Size: 20.5 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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.