tags:

views:

213

answers:

1

Is there a way to do dbrefs using the Perl API? Its not here nor is it anywhere here.

Here s a sample schema:

book: name, publisher,isdn,{author}
author : name,date of birth

I could just add a field to serve as the reference but wanted to do it with dbref instead. Did I miss something?

+1  A: 

There are no helpers for it, yet. DBRefs are just normal hashes, though, so you can access/create them yourself. They have the form:

 my $ref = {'$ref' => $collection_name, '$id' => $id};

See http://www.mongodb.org/display/DOCS/DB+Ref for more info.

kristina
Is this supposed to drastically increase insert time?
ankimal
no, it will take the same amount of time as any other insert.
kristina