MongoDBx::AutoDeref::DBRef - DBRef representation in Perl
version 1.110560
MongoDBx::AutoDeref::DBRef is the Perl space representation of Mongo database references. These ideally shouldn't be constructed manually, but instead should be constructed by the internal MongoDBx::AutoDeref::LookMeUp class.
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.
is: ro, isa: MongoDB::OID, reader: id, required: 1
This is the OID of the object.
is: ro, isa: Str, reader: ref, required: 1
This is the collection in which this item resides.
is: ro, isa: Str, reader: db, required: 1
This is the database in which this item resides.
is: ro, isa: MongoDBx::AutoDeref::LookMeUp, weak_ref: 1, required: 1
When fetching referenced documents, those documents may in turn reference other documents. By providing a LookMeUp object, those other references can also be travered as DBRefs.
This method returns a hash reference in the DBRef format suitable for MongoDB serialization.
(HashRef?)
fetch takes the information contained in the "$db", "$ref", "$id" attributes and applies them via the "mongo_connection" to retrieve the document that is referenced.
fetch also accepts a hashref of fields-as-keys that will be passed unaltered directly to the MongoDB driver as a way to limit the fields pulled back.
Nicholas R. Perez <nperez@cpan.org>
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.
To install MongoDBx::AutoDeref, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MongoDBx::AutoDeref
CPAN shell
perl -MCPAN -e shell install MongoDBx::AutoDeref
For more information on module installation, please visit the detailed CPAN module installation guide.