Skip to content

Commit 49069eb

Browse files
committed
update mongo driver to v4
1 parent dac3759 commit 49069eb

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

models/Mongo/Collection.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ component name="MongoCollection" accessors="true" {
7373
* @param struct [criteria] A criteria struct which restricts the counted document
7474
*/
7575
public function count( criteria = {} ){
76-
return getDBCollection().count( getMongoUtil().toMongo( arguments.criteria ) );
76+
return getDBCollection().countDocuments( getMongoUtil().toMongo( arguments.criteria ) );
7777
}
7878

7979
/**

test-harness/tests/specs/integration/TestGEOEntity.cfc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ component
7373
expect( kent ).toBeComponent();
7474

7575
expect(
76-
kent.whereNotI()
77-
.near( "geometry", "this.geometry" )
78-
.count()
76+
arrayLen(
77+
kent.whereNotI()
78+
.near( "geometry", "this.geometry" )
79+
.findAll()
80+
)
7981
).toBe( 3 );
8082
} );
8183
} );

test-harness/tests/specs/unit/testMongoUtil.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ component name="TestMongoUtil" extends="tests.specs.CBMongoDBBaseTest" {
4343
var doc = MongoUtil.toMongoDocument( { "one" : 1, "two" : 2, "three" : 3 } );
4444
variables.activeCollection.insertOne( doc );
4545
}
46-
expect( variables.activeCollection.count() ).toBe( 5 );
46+
expect( variables.activeCollection.countDocuments() ).toBe( 5 );
4747
describe( "Tests dbResult manipulation methods", function(){
4848
it( "tests the encapsulateDBResult() method", function(){
4949
var dbResult = variables.activeCollection.find();

0 commit comments

Comments
 (0)