com presentations: Use integers for projections: slides/mongodb/query-advanced-example-gte.xml slides/mongodb/update-modifiers3.xml
[email protected] (Derick Rethans)
| Newsgroups | php.pres |
|---|---|
| Message-ID | <[email protected]> |
Commit: 72caa2be24e2ba7f37443c91950dc90769ee7266 Author: Jeremy Mikola <[email protected]> Sun, 17 May 2015 15:26:40 -0500 Parents: c42e74f7e99da833b8c0fc2e056d3d09b5cd6ecd Branches: master Link: http://git.php.net/?p=presentations.git;a=commitdiff;h=72caa2be24e2ba7f37443c91950dc90769ee7266 Log: Use integers for projections Changed paths: M slides/mongodb/query-advanced-example-gte.xml M slides/mongodb/update-modifiers3.xml Diff: diff --git a/slides/mongodb/query-advanced-example-gte.xml b/slides/mongodb/query-advanced-example-gte.xml index d370690..fffbcf5 100644 --- a/slides/mongodb/query-advanced-example-gte.xml +++ b/slides/mongodb/query-advanced-example-gte.xml @@ -27,7 +27,7 @@ $r = $c->find( // query [ 'population' => [ '$gte' => 12000000 ] ], // projection - [ 'name' => true, 'population' => true, '_id' => false ] + [ 'name' => 1, 'population' => 1, '_id' => 0 ] ); foreach( $r as $res ) diff --git a/slides/mongodb/update-modifiers3.xml b/slides/mongodb/update-modifiers3.xml index dc1a9db..a538665 100644 --- a/slides/mongodb/update-modifiers3.xml +++ b/slides/mongodb/update-modifiers3.xml @@ -17,6 +17,6 @@ $c->update( [ '_id' => 'circ5' ], [ '$push' => [ 'elephpants' => [ 'name' => 'Bobo', 'year' => 2012 ] ] ] ); -var_dump( $c->findOne( [ 'name' => 'Funny Led' ], [ 'elephpants' => true ] ) ); +var_dump( $c->findOne( [ 'name' => 'Funny Led' ], [ 'elephpants' => 1 ] ) ); ?>]]></example> </slide>