Error -GetComment ticket

com.mongodb.MongoCommandException: Command failed with error 16819 (Location16819): ‘Sort exceeded memory limit of 104857600 bytes, but did not opt in to external sorting. Aborting operation. Pass allowDiskUse:true to opt in.’ on server cluster0-shard-00-00-hhrit.mongodb.net:27017. The full response is { “operationTime” : { “$timestamp” : { “t” : 1569880752, “i” : 2 } }, “ok” : 0.0, “errmsg” : “Sort exceeded memory limit of 104857600 bytes, but did not opt in to external sorting. Aborting operation. Pass allowDiskUse:true to opt in.”, “code” : 16819, “codeName” : “Location16819”, “$clusterTime” : { “clusterTime” : { “$timestamp” : { “t” : 1569880752, “i” : 2 } }, “signature” : { “hash” : { “$binary” : “raAE4pwpJJYwUgiXaCwIWnz4xzY=”, “$type” : “00” }, “keyId” : { “$numberLong” : “6738349885474471937” } } } }

at com.mongodb.internal.connection.ProtocolHelper.getCommandFailureException(ProtocolHelper.java:179)
at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:299)
at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:255)
at com.mongodb.internal.connection.UsageTrackingInternalConnection.sendAndReceive(UsageTrackingInternalConnection.java:99)
at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection.sendAndReceive(DefaultConnectionPool.java:444)
at com.mongodb.internal.connection.CommandProtocolImpl.execute(CommandProtocolImpl.java:72)
at com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:200)
at com.mongodb.internal.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:269)
at com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:131)
at com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:123)
at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:242)
at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:233)
at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:136)
at com.mongodb.operation.AggregateOperationImpl$1.call(AggregateOperationImpl.java:193)
at com.mongodb.operation.AggregateOperationImpl$1.call(AggregateOperationImpl.java:189)

Please recheck your query. You can always explain a query to check if it is optimum or not. :slight_smile:

Kanika