Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the MongoDB CPAN distribution.

Maintainer(s)' notes

Please don't report bugs here. Please use the MongoDB Perl driver issue tracker instead.

Report information
The Basics
Id: 54345
Status: resolved
Priority: 0/
Queue: MongoDB

People
Owner: Nobody in particular
Requestors: jettero [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.28
Fixed in: (no value)



Subject: Curious Crash in ensure_index() easily reproduced
$collection->ensure_index($hashref, ($unique=1)); # ok! $collection->ensure_index($hashref, ($unique=0)); # crash! If $unique is undefined it works great. I submit that 0 is a valid false value in perl. -- If riding in an airplane is flying, then riding in a boat is swimming. 114 jumps, 47.2 minutes of freefall, 90.4 freefall miles.
On Fri Feb 05 10:23:53 2010, JETTERO wrote: Show quoted text
> $collection->ensure_index($hashref, ($unique=1)); # ok! > > $collection->ensure_index($hashref, ($unique=0)); # crash! > > If $unique is undefined it works great. I submit that 0 is a valid > false value in perl.
It seems this is more of a docbug, if anything. I was using http://www.mongodb.org/display/DOCS/Perl+Tutorial#PerlTutorial- CreatinganIndex rather than http://search.cpan.org/~kristina/MongoDB/lib/MongoDB/Collection.pm#ens ure_index_(\%keys,_$options?) I didn't actually understand that MongoDB had more pods because there's no SEE ALSO section at the bottom of the first pod. -- If riding in an airplane is flying, then riding in a boat is swimming. 114 jumps, 47.2 minutes of freefall, 90.4 freefall miles.
Yeah, that tutorial is hideously out of date. I've created a redirect to the CPAN docs. Thanks for the report!