<commit_before>package MongoDB::DBRef;

# ABSTRACT: Native DBRef support

use Moose;
use Moose::Util::TypeConstraints;
use Carp 'croak';


subtype DBRefColl => as 'Str';
subtype DBRefDB   => as 'Str';

coerce 'DBRefColl'
  => from 'MongoDB::Collection'
  => via  { $_->name };

coerce 'DBRefDB' 
  => from 'MongoDB::Database'
  => via  { $_->name };


# no type constraint since an _id can be anything
has id => (
    is        => 'rw',
    required  => 1 
);

has ref => (
    is        => 'rw',
    isa       => 'DBRefColl',
    required  => 1,
    coerce    => 1,
);

has db => ( 
    is        => 'rw',
    isa       => 'DBRefDB',
    required  => 1,
    coerce    => 1,
);

has client => (
    is        => 'ro',
    isa       => 'MongoDB::MongoClient',
    required  => 0
);

has verify_db => (
    is        => 'rw',
    isa       => 'Bool',
    required  => 0,
    default   => 1
);

has verify_coll => ( 
    is        => 'rw',
    isa       => 'Bool',
    required  => 0,<commit_msg>make client attr writeable<commit_after>package MongoDB::DBRef;

# ABSTRACT: Native DBRef support

use Moose;
use Moose::Util::TypeConstraints;
use Carp 'croak';


subtype DBRefColl => as 'Str';
subtype DBRefDB   => as 'Str';

coerce 'DBRefColl'
  => from 'MongoDB::Collection'
  => via  { $_->name };

coerce 'DBRefDB' 
  => from 'MongoDB::Database'
  => via  { $_->name };


# no type constraint since an _id can be anything
has id => (
    is        => 'rw',
    required  => 1 
);

has ref => (
    is        => 'rw',
    isa       => 'DBRefColl',
    required  => 1,
    coerce    => 1,
);

has db => ( 
    is        => 'rw',
    isa       => 'DBRefDB',
    required  => 1,
    coerce    => 1,
);

has client => (
    is        => 'rw',
    isa       => 'MongoDB::MongoClient',
    required  => 0
);

has verify_db => (
    is        => 'rw',
    isa       => 'Bool',
    required  => 0,
    default   => 1
);

has verify_coll => ( 
    is        => 'rw',
    isa       => 'Bool',
    required  => 0,
{'fraction_non_alphanumeric': 0.16908454227113556, 'fraction_numerical': 0.009004502251125562, 'mean_word_length': 1.932551319648094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 71, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7516920', 'n_tokens_mistral': 767, 'n_tokens_neox': 716, 'n_words': 190}