Skip to content

Instantly share code, notes, and snippets.

@gatesvp
Created May 1, 2011 03:04
Show Gist options
  • Select an option

  • Save gatesvp/950206 to your computer and use it in GitHub Desktop.

Select an option

Save gatesvp/950206 to your computer and use it in GitHub Desktop.
Testing spaces + PHP + mongodb
<?php
$mongo = new Mongo();
$coll = $mongo->selectCollection('foo', 'documents');
$coll->drop();
$coll->insert( array( "bar foo" => array( 'bah baz' => 2 ) ) );
$res = $coll->find(array('bar foo.bah baz' => 2));
foreach($res as $r){
print_r($r);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment