ejson 0.2.0-pre.1 copy "ejson: ^0.2.0-pre.1" to clipboard
ejson: ^0.2.0-pre.1 copied to clipboard

EJSON serialization. BSON is a binary format used to store JSON-like documents efficiently. EJSON extends JSON defining how all BSON types should be represented in JSON.

example/main.dart

// Copyright 2024 MongoDB, Inc.
// SPDX-License-Identifier: Apache-2.0

import 'dart:convert';

import 'package:ejson/ejson.dart';
import 'package:test/test.dart';

void main() {
  test('round-trip', () {
    final value = {
      'abe': [1, 4],
      'kat': <int>[],
    };
    final encoded = toEJson(value);
    final json = jsonEncode(encoded);
    print(json);
    final decoded = fromEJson<Map<String, List<int>>>(jsonDecode(json));
    expect(value, decoded);
  });
}
1
likes
0
pub points
62%
popularity

Publisher

verified publisherrealm.io

EJSON serialization. BSON is a binary format used to store JSON-like documents efficiently. EJSON extends JSON defining how all BSON types should be represented in JSON.

Repository (GitHub)
View/report issues

Topics

#ejson #bson #json #build-runner #codegen

License

unknown (license)

Dependencies

collection, ejson_annotation, objectid, sane_uuid, type_plus

More

Packages that depend on ejson