The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

MongoDBx::AutoDeref::LookMeUp - Provides the sieve that replaces DBRefs with deferred scalars.

VERSION

version 1.110520

DESCRIPTION

This module provides the guts for MongoDBx::AutoDeref. It modifies documents in place to replace DBRefs with defered lookups of the actual document.

PUBLIC_ATTRIBUTES

mongo_connection

    is: ro, isa: MongoDB::Connection, required: 1

In order to defer fetching the referenced document, a connection object needs to be accessible. This is required for construction of the object.

visitor

    is: ro, isa: Data::Visitor::Callback
    lazy: 1, builder => _build_visitor
    handles: sieve => visit

In order to find the DBRefs within the returned document, Data::Visitor is used to traverse the structure. This attribute is built using the provided builder with the default "hash_visit_action" setup to build the lazy look up.

hash_visit_action

    is: ro, isa: CodeRef
    builder: _build_hash_visit_action
    lazy: 1

This attribute holds the code reference that will be executed upon each hash found within the data structure returned from MongoDB. By default, the coderef built using the builder method uses "lazy" in Scalar::Defer to defer lookup of the referenced document until access time.

PUBLIC_METHODS

sieve

    (HashRef)

This method takes the returned document from MongoDB and traverses it to replace DBRefs with defered lookups of the actual document. It does this IN PLACE on the document.

AUTHOR

Nicholas R. Perez <nperez@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Nicholas R. Perez <nperez@cpan.org>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.