Mongoose::Engine - serialization for MongoDB driver
The Mongoose standard engine. Does all the dirty work. Very monolithic. Replace it with your engine if you want.
Just like "find_one" in MongoDB::Collection, but blesses the hash document into your class package.
Also has a handy mode which allows retrieving an _id directly from a BSON:OID or just a string:
_id
my $author = Author->find_one( '4dd77f4ebf4342d711000000' );
Which expands onto:
my $author = Author->find_one({ _id => BSON::OID->new( value => pack( 'H*', '4dd77f4ebf4342d711000000' ) ) });
Just like "find" in MongoDB::Collection, but returns a Mongoose::Cursor of documents blessed into your package.
Just like "query" in MongoDB::Collection, but returns a Mongoose::Cursor of documents blessed into your package.
Helper and back-compat method to call estimated_document_count() or count_documents() depending on arguments passed.
Just like "estimated_document_count" in MongoDB::Collection.
Just like "count_documents" in MongoDB::Collection.
Deletes the document in the database.
Turns an object into a hash document.
Turns a hash document back into an object.
This is an empty method called by expand() after a document was turned into an object. This was added in version 2 to allow old classes to handle dates on nested types that previously were DateTime objects and now are BSON::Time, but it can be used/abused to any kind of fix to the expanded object.
It's recommended to use with care and alway using method modifiers (after) to allow subclassing and composition.
Returns the MongoDB::Collection object for this class or object.
Commits the object to the database.
Returns the object's corresponding MongoDB::Database instance.
Checks all Mongoose::Join fields for invalid references to foreign object ids.
To install Mongoose, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mongoose
CPAN shell
perl -MCPAN -e shell install Mongoose
For more information on module installation, please visit the detailed CPAN module installation guide.