bson_codec 0.2.0

bson_codec

Build Status

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<int> 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.

Changelog

0.2.0

  • BsonEncoder/BsonDecoder supports chunked conversions

0.1.0

  • Initial version

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  bson_codec: "^0.2.0"

2. Install it

You can install packages from the command line:

$ pub get

Alternatively, your editor might support pub. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:bson_codec/bson_codec.dart';

About

A BSON codec for Dart.

Author

Email kwangyul.seo@gmail.com Kwang Yul Seo

Homepage

github.com/kseo/bson_codec

Documentation

www.dartdocs.org/documentation/bson_codec/0.2.0/

Source code (hyperlinked)

www.crossdart.info/p/bson_codec/0.2.0/

Uploader

kwangyul.seo@gmail.com

Share