question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The 'cursor' option is required, except for aggregate with the explain argument.

See original GitHub issue

throw 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.CommandWireProtocol1.ProcessReply(ConnectionId connectionId, ReplyMessage1 reply) at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol1.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, Func1 responseHandling, Boolean slaveOk, IBsonSerializer1 resultSerializer, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken) at MongoDB.Driver.Core.Operations.CommandOperationBase1.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.ReadCommandOperation1.Execute(IReadBinding binding, CancellationToken cancellationToken) at MongoDB.Driver.OperationExecutor.ExecuteReadOperation[TResult](IReadBinding binding, IReadOperation1 operation, CancellationToken cancellationToken) at MongoDB.Driver.MongoDatabaseImpl.ExecuteReadOperation[T](IReadOperation1 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.List1.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. image Add a few lines of code here : { "cursor", new Dictionary<string, object> { { "batchSize", 0 } } } image 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:closed
  • Created 6 years ago
  • Comments:13

github_iconTop GitHub Comments

1reaction
MarLoecommented, Sep 12, 2017

@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 😃

0reactions
MarLoecommented, Sep 21, 2017

The fix has been included in the 0.5.3 release. It should be available on nuget.org shortly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring data mongodb - The 'cursor' option is required
I am trying to execute an aggregate operation using Spring Data MongoDB 3.6-rc4. Aggregation agg = newAggregation( lookup("orders", "orderId", " ...
Read more >
[#SERVER-33393] The 'cursor' option is required, except ...
The 'cursor ' option is required, except for aggregate with the explain argument. Status: Assignee: Priority: Resolution:.
Read more >
The 'cursor' option is required, except for aggregate with ...
Hi After running a mongo and mirrogate dockers (from readme files) and trying to save a dashboard I got an error :com.mongodb.
Read more >
mongofb 3.6 JRException: The 'cursor' option is required, ...
JRRuntimeException: net.sf.jasperreports.engine.JRException: The 'cursor' option is required, except for aggregate with the explain argument
Read more >
Node.js – Mongodb error : The 'cursor' option is required, ...
js – Mongodb error : The 'cursor' option is required, except for aggregation explain. mongodbmongoosenode.js. I am using the mongodb 3.5.5 with mongoose...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found