Browse Source

remove unsupported options argument in count() method of mongojs 1.x

Brian Gough 10 years ago
parent
commit
c7b4062412

+ 2 - 2
services/track-changes/app/coffee/MongoManager.coffee

@@ -153,10 +153,10 @@ module.exports = MongoManager =
 		db.docHistoryStats.ensureIndex { updates: -1, doc_id: 1 }, { background: true }
 		db.docHistoryStats.ensureIndex { updates: -1, doc_id: 1 }, { background: true }
 
 
 	getDocChangesCount: (doc_id, callback)->
 	getDocChangesCount: (doc_id, callback)->
-		db.docHistory.count { doc_id : ObjectId(doc_id.toString()), inS3 : { $exists : false }}, {}, callback
+		db.docHistory.count { doc_id : ObjectId(doc_id.toString()), inS3 : { $exists : false }}, callback
 
 
 	getArchivedDocChanges: (doc_id, callback)->
 	getArchivedDocChanges: (doc_id, callback)->
-		db.docHistory.count { doc_id: ObjectId(doc_id.toString()) , inS3: { $exists: true }}, {}, callback
+		db.docHistory.count { doc_id: ObjectId(doc_id.toString()) , inS3: { $exists: true }}, callback
 
 
 	markDocHistoryAsArchiveInProgress: (doc_id, update, callback) ->
 	markDocHistoryAsArchiveInProgress: (doc_id, update, callback) ->
 		db.docHistory.update { _id: update._id }, { $set : { inS3 : false } }, callback
 		db.docHistory.update { _id: update._id }, { $set : { inS3 : false } }, callback

+ 2 - 4
services/track-changes/test/unit/coffee/MongoManager/MongoManagerTests.coffee

@@ -395,7 +395,7 @@ describe "MongoManager", ->
 	describe "getDocChangesCount", ->
 	describe "getDocChangesCount", ->
 		beforeEach ->
 		beforeEach ->
 			@db.docHistory =
 			@db.docHistory =
-				count: sinon.stub().callsArg(2)
+				count: sinon.stub().callsArg(1)
 			@MongoManager.getDocChangesCount @doc_id, @callback
 			@MongoManager.getDocChangesCount @doc_id, @callback
 
 
 		it "should return if there is any doc changes", ->
 		it "should return if there is any doc changes", ->
@@ -403,7 +403,6 @@ describe "MongoManager", ->
 				.calledWith({
 				.calledWith({
 					doc_id: ObjectId(@doc_id)
 					doc_id: ObjectId(@doc_id)
 					inS3 : { $exists : false }
 					inS3 : { $exists : false }
-				}, {
 				})
 				})
 				.should.equal true
 				.should.equal true
 
 
@@ -413,7 +412,7 @@ describe "MongoManager", ->
 	describe "getArchivedDocChanges", ->
 	describe "getArchivedDocChanges", ->
 		beforeEach ->
 		beforeEach ->
 			@db.docHistory =
 			@db.docHistory =
-				count: sinon.stub().callsArg(2)
+				count: sinon.stub().callsArg(1)
 			@MongoManager.getArchivedDocChanges @doc_id, @callback
 			@MongoManager.getArchivedDocChanges @doc_id, @callback
 
 
 		it "should return if there is any archived doc changes", ->
 		it "should return if there is any archived doc changes", ->
@@ -421,7 +420,6 @@ describe "MongoManager", ->
 				.calledWith({
 				.calledWith({
 					doc_id: ObjectId(@doc_id)
 					doc_id: ObjectId(@doc_id)
 					inS3: {$exists: true}
 					inS3: {$exists: true}
-				}, {
 				})
 				})
 				.should.equal true
 				.should.equal true