File tree Expand file tree Collapse file tree 2 files changed +26
-8
lines changed Expand file tree Collapse file tree 2 files changed +26
-8
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,29 @@ var Shimmer = require('../utils/shimmer')
22var consts = require ( '../consts' )
33
44var COLLECTION_OPERATIONS = [
5- 'find' ,
6- 'findOne'
5+ 'aggregate' ,
6+ 'count' ,
7+ 'deleteMany' ,
8+ 'deleteOne' ,
9+ 'distinct' ,
10+ 'findAndModify' ,
11+ 'findAndRemove' ,
12+ 'findOne' ,
13+ 'findOneAndDelete' ,
14+ 'findOneAndReplace' ,
15+ 'findOneAndUpdate' ,
16+ 'geoHaystackSearch' ,
17+ 'geoNear' ,
18+ 'group' ,
19+ 'insert' ,
20+ 'insertMany' ,
21+ 'insertOne' ,
22+ 'mapReduce' ,
23+ 'remove' ,
24+ 'save' ,
25+ 'update' ,
26+ 'updateMany' ,
27+ 'updateOne'
728]
829
930module . exports = function ( mongodb , agent ) {
@@ -63,3 +84,5 @@ module.exports = function (mongodb, agent) {
6384
6485 return mongodb
6586}
87+
88+ module . exports . _COLLECTION_OPERATIONS = COLLECTION_OPERATIONS
Original file line number Diff line number Diff line change @@ -4,11 +4,6 @@ var expect = require('chai').expect
44var wrapper = require ( './mongodb' )
55var Shimmer = require ( '../utils/shimmer' )
66
7- var COLLECTION_OPERATIONS = [
8- 'find' ,
9- 'findOne'
10- ]
11-
127describe ( 'The mongodb wrapper module' , function ( ) {
138 it ( 'should wrap collection\'s operations' , function ( ) {
149 var shimmerWrapStub = this . sandbox . stub ( Shimmer , 'wrap' )
@@ -23,7 +18,7 @@ describe('The mongodb wrapper module', function () {
2318 expect ( shimmerWrapStub ) . to . have . been . calledWith (
2419 fakeMongo . Collection . prototype ,
2520 'mongodb.Collection.prototype' ,
26- COLLECTION_OPERATIONS
21+ wrapper . _COLLECTION_OPERATIONS
2722 )
2823 } )
2924
You can’t perform that action at this time.
0 commit comments