NAME

Tie::Hash::MongoDB - Tie a hash to a MongoDB document

Every single action to the hash is directly processed on the MongoDB server, remember this while using this module!

VERSION

Version 0.01

SYNOPSIS

    use Tie::Hash::MongoDB;

    tie %foo,'Tie::Hash::MongoDB',$id,{
		server     => 'localhost',
		database   => 'default',
		collection => 'default',
    	};

Tie a MongoDB document to a Perl hash.

tie arguments: 1. the hash to be tied 2. this modules name 3. the document id or undef for a new document 4. connection arguments for the MongoDB interface

METHODS

TIEHASH

    tie %foo,'Tie::Hash::MongoDB',$id,{
		server     => 'localhost',
		database   => 'default',
		collection => 'default',
    	};

Tie the MongoDB document or create a new one.

DELETE

$object->DELETE($key)

Remove a key from the document.

No return value.

EXISTS

$object->EXISTS($key)

Returns true if the key exists or false otherwise.

FETCH

$object->FETCH($key)

Returns the current value of a key.

Returns undef if the key doesn't exist or has an undef value.

FIRSTKEY

$object->FIRSTKEY

Returns the first key of the document.

NEXTKEY

$object->NEXTKEY

Returns the next key of the document or nothing at the end of the list.

STORE

$object->STORE($key,$value)

Add or update a key.

UNTIE

$object->UNTIE

Unties the hash from the document.

AUTHOR

Sebastian Willing, <sewi at cpan.org>

BUGS

Please report any bugs or feature requests to bug-tie-hash-mongodb at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Tie-Hash-MongoDB. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Tie::Hash::MongoDB

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2011 Sebastian Willing.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.