@@ -47,7 +47,31 @@ public function getQueries()
4747 'bin data ' => [
4848 ['db ' => 'foo ' , 'collection ' => 'bar ' , 'update ' => true , 'query ' => ['_id ' => 'foo ' ], 'newObj ' => ['foo ' => new \MongoBinData ('junk data ' , \MongoBinData::BYTE_ARRAY )]],
4949 ['use foo; ' , 'db.bar.update({ "_id": "foo" }, { "foo": new BinData(2, " ' . base64_encode ('junk data ' ) . '") }); ' ],
50- ]
50+ ],
51+ 'findWithoutQuery ' => [
52+ ['db ' => 'foo ' , 'collection ' => 'bar ' , 'find ' => true , 'fields ' => []],
53+ ['use foo; ' , 'db.bar.find({ }); ' ],
54+ ],
55+ 'findWithoutFields ' => [
56+ ['db ' => 'foo ' , 'collection ' => 'bar ' , 'find ' => true , 'query ' => ['foo ' => null ]],
57+ ['use foo; ' , 'db.bar.find({ "foo": null }); ' ],
58+ ],
59+ 'count ' => [
60+ ['db ' => 'foo ' , 'collection ' => 'bar ' , 'count ' => true ],
61+ ['use foo; ' , 'db.bar.count(); ' ],
62+ ],
63+ 'countWithQuery ' => [
64+ ['db ' => 'foo ' , 'collection ' => 'bar ' , 'count ' => true , 'query ' => ['foo ' => null ]],
65+ ['use foo; ' , 'db.bar.count({ "foo": null }); ' ],
66+ ],
67+ 'countWithSkipOnly ' => [
68+ ['db ' => 'foo ' , 'collection ' => 'bar ' , 'count ' => true , 'skip ' => ['skip ' => true , 'limitSkip ' => 5 ]],
69+ ['use foo; ' , 'db.bar.count({ }, { "skip": 5 }); ' ],
70+ ],
71+ 'countWithLimitOnly ' => [
72+ ['db ' => 'foo ' , 'collection ' => 'bar ' , 'count ' => true , 'limit ' => ['limit ' => true , 'limitNum ' => 3 ]],
73+ ['use foo; ' , 'db.bar.count({ }, { "limit": 3 }); ' ],
74+ ],
5175 ];
5276 }
5377
@@ -149,7 +173,7 @@ public function testQueryCountVsGridFsStoreFile()
149173 ];
150174 $ formatted = [
151175 'use foo; ' ,
152- 'db.Route.count({ "path": "/" }, { "limit": true, "limitNum": 5 }, { "skip": true, "limitSkip ": 0 }); ' ,
176+ 'db.Route.count({ "path": "/" }, { "limit": 5, "skip": 0 }); ' ,
153177 'db.User.files.storeFile(5, [ ]); ' ,
154178 ];
155179
0 commit comments