MongoDBx::Class::Reference3pm
An embedded document representing a reference to a different document (thus establishing a relationship)
Version
version 1.030002
Consumes
MongoDBx::Class::EmbeddedDocument
Overview
This class represents a reference (or "join") to a MongoDB document. In MongoDBx::Class, references are expected to be in the DBRef format, as defined in <http://www.mongodb.org/display/DOCS/Database+References>, for example (this is a JSON example):
{ "$ref": "collection_name", "$id": ObjectId("4cbca90d3a41e35916720100") }
Attributes
Aside from attributes provided by MongoDBx::Class::EmbeddedDocument, the following attributes are provided:
ref_coll
A string representing the collection in which the reference document is stored (translates to the '$ref' hash key above).
ref_id
A MongoDB::OID object with the internal ID of the referenced document (translates to the '$id' hash key above).
Methods
Aside from methods provided by MongoDBx::Class::EmbeddedDocument, the following methods are provided:
load()
Returns the document referenced by this object, after expansion. This is mostly used internally, you don't have to worry about it.
Support
You can find documentation for this module with the perldoc command.
perldoc MongoDBx::Class::Reference
You can also look for information at:
- •
-
RT: CPAN's request tracker
<http://rt.cpan.org/NoAuth/Bugs.html?Dist=MongoDBx::Class>
- •
-
AnnoCPAN: Annotated CPAN documentation
<http://annocpan.org/dist/MongoDBx::Class>
- •
-
CPAN Ratings
<http://cpanratings.perl.org/d/MongoDBx::Class>
- •
-
Search CPAN
<http://search.cpan.org/dist/MongoDBx::Class/>
License and copyright
Copyright 2010-2014 Ido Perlmuter.
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.