The 'cursor' option is required, except for aggregate with the explain argument.
See original GitHub issuethrow MongoDB.Driver.MongoCommandException HResult=0x80131500 Message=Command aggregate failed: The 'cursor' option is required, except for aggregate with the explain argument. StackTrace: at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol
1.ProcessReply(ConnectionId connectionId, ReplyMessage1 reply) at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol
1.Execute(IConnection connection, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Servers.Server.ServerChannel.ExecuteProtocol[TResult](IWireProtocol1 protocol, CancellationToken cancellationToken) at MongoDB.Driver.Core.Servers.Server.ServerChannel.Command[TResult](DatabaseNamespace databaseNamespace, BsonDocument command, IElementNameValidator commandValidator, Func
1 responseHandling, Boolean slaveOk, IBsonSerializer1 resultSerializer, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken) at MongoDB.Driver.Core.Operations.CommandOperationBase
1.ExecuteProtocol(IChannelHandle channel, ServerDescription serverDescription, ReadPreference readPreference, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.CommandOperationBase1.ExecuteProtocol(IChannelSource channelSource, ReadPreference readPreference, CancellationToken cancellationToken) at MongoDB.Driver.Core.Operations.ReadCommandOperation
1.Execute(IReadBinding binding, CancellationToken cancellationToken)
at MongoDB.Driver.OperationExecutor.ExecuteReadOperation[TResult](IReadBinding binding, IReadOperation1 operation, CancellationToken cancellationToken) at MongoDB.Driver.MongoDatabaseImpl.ExecuteReadOperation[T](IReadOperation
1 operation, ReadPreference readPreference, CancellationToken cancellationToken)
at MongoDB.Driver.MongoDatabaseImpl.RunCommand[TResult](Command1 command, ReadPreference readPreference, CancellationToken cancellationToken) at Hangfire.Mongo.Migration.Strategies.MongoMigrationStrategyMigrate.BackupCollection(HangfireDbContext database, String collectionName, MongoSchema currentSchema) in D:\work\MongoDBTest\src\Hangfire.Mongo\src\Hangfire.Mongo\Migration\Strategies\MongoMigrationStrategyMigrate.cs:line 97 at Hangfire.Mongo.Migration.Strategies.MongoMigrationStrategyMigrate.Migrate(MongoSchema fromSchema, MongoSchema toSchema) in D:\work\MongoDBTest\src\Hangfire.Mongo\src\Hangfire.Mongo\Migration\Strategies\MongoMigrationStrategyMigrate.cs:line 38 at Hangfire.Mongo.Migration.MongoMigrationManager.Migrate(HangfireDbContext dbContext) in D:\work\MongoDBTest\src\Hangfire.Mongo\src\Hangfire.Mongo\Migration\MongoMigrationManager.cs:line 72 at Hangfire.Mongo.MongoStorage..ctor(String connectionString, String databaseName, MongoStorageOptions storageOptions) in D:\work\MongoDBTest\src\Hangfire.Mongo\src\Hangfire.Mongo\MongoStorage.cs:line 68 at Hangfire.Mongo.MongoBootstrapperConfigurationExtensions.UseMongoStorage(IGlobalConfiguration configuration, String connectionString, String databaseName, MongoStorageOptions storageOptions) in D:\work\MongoDBTest\src\Hangfire.Mongo\src\Hangfire.Mongo\MongoBootstrapperConfigurationExtensions.cs:line 115 at MAS.MASWebCoreModule.<>c__DisplayClass3_0.<PreInitialize>b__0(IAbpHangfireConfiguration configuration) in D:\work\MongoDBTest\src\MAS.Web.Core\MASWebCoreModule.cs:line 64 at MAS.MASWebCoreModule.PreInitialize() in D:\work\MongoDBTest\src\MAS.Web.Core\MASWebCoreModule.cs:line 62 at System.Collections.Generic.List
1.ForEach(Action1 action) at Abp.Modules.AbpModuleManager.StartModules() at Abp.AbpBootstrapper.Initialize()
I’m trying to solve this exception.
I google search other MongoDB components found that have similar problems.
Download your code, breakpoint debugging.
In the BackupCollection method of the MongoMigrationStrategyMigrate class, the last line of code throws an exception.
Add a few lines of code here :
{ "cursor", new Dictionary<string, object> { { "batchSize", 0 } } }
I’ve successfully eliminated this exception.
I think this cursor is a required option and should be passed in by the developer from the front.
Can you merge the problem in the next version?
Be deeply grateful.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13
@VAllens, thank you for your detailed report and preliminary research. I’ll take a look at this, and eventually bring it into the next release. The next release is 0.6.0 and it is coming soon 😃
The fix has been included in the 0.5.3 release. It should be available on nuget.org shortly.