Giter Site home page Giter Site logo

perl-bson's Introduction

NAME
    BSON - Pure Perl implementation of MongoDB's BSON serialization

VERSION
    Version 0.11

SYNOPSIS
        use BSON qw/encode decode/;

        my $document = {
            _id      => BSON::ObjectId->new,
            date     => BSON::Time->new,
            name     => 'James Bond',
            age      => 45,
            amount   => 24587.45,
            badass   => BSON::Bool->true,
            password => BSON::String->new('12345')
        };

        my $bson = encode( $document );
        my $doc2 = decode( $bson, %options );

DESCRIPTION
    This module implements BSON serialization and deserialization as
    described at <http://bsonspec.org>. BSON is the primary data
    representation for MongoDB.

EXPORT
    The module does not export anything. You have to request "encode" and/or
    "decode" manually.

        use BSON qw/encode decode/;

SUBROUTINES
  encode
    Takes a hashref and returns a BSON string.

        my $bson = encode({ bar => 'foo' });

  decode
    Takes a BSON string and returns a hashref.

        my $hash = decode( $bson, ixhash => 1 );

    The options after $bson are optional and they can be any of the
    following:

   options
    1   ixhash => 1|0

        If set to 1 "decode" will return a Tie::IxHash ordered hash.
        Otherwise, a regular unordered hash will be returned. Turning this
        option on entails a significant speed penalty as Tie::IxHash is
        slower than a regular Perl hash. The default value for this option
        is 0.

THREADS
    This module is thread safe.

LIMITATION
    MongoDB sets a limit for any BSON record to 16MB. This module does not
    enforce this limit and you can use it to "encode" and "decode"
    structures as large as you please.

CAVEATS
    BSON uses zero terminated strings and Perl allows the \0 character to be
    anywhere in a string. If you expect your strings to contain \0
    characters, use BSON::Binary instead.

SEE ALSO
    BSON::String, BSON::Time, BSON::ObjectId, BSON::Code, BSON::Binary,
    BSON::Bool, BSON::MinKey, BSON::MaxKey, BSON::Timestamp, Tie::IxHash,
    MongoDB

AUTHOR
    minimalist, "<minimalist at lavabit.com>"

CONTRIBUTORS
    Oleg Kostyuk "<[email protected]>"

BUGS
    Bug reports and patches are welcome. Reports which include a failing
    Test::More style test are helpful and will receive priority.

DEVELOPMENT
    The source code of this module is available on GitHub:
    <https://github.com/naturalist/Perl-BSON>

LICENSE AND COPYRIGHT
    Copyright 2011 minimalist.

    This program is free software; you can redistribute it and/or modify it
    under the terms as perl itself.

perl-bson's People

Contributors

tadam avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.