无法通过 mongo compass 创建数据库

Unable to create database via mongo compass

在 mongodb 内创建数据库并抛出拓扑错误。

拓扑被破坏

附上截图

Topology was destroyed 错误出现,当 mongodb 正在写东西并且连接是 closed/interrupted 在中间。

查看引发此错误的 code

Mongos.prototype.insert = function(ns, ops, options, callback) {
  if(typeof options == 'function') callback = options, options = {}, options = options || {};
  if(this.state == DESTROYED) return callback(new MongoError(f('topology was destroyed')));

  // Not connected but we have a disconnecthandler
  if(!this.isConnected() && this.s.disconnectHandler != null) {
    return this.s.disconnectHandler.add('insert', ns, ops, options, callback);
  }

  // No mongos proxy available
  if(!this.isConnected()) {
    return callback(new MongoError('no mongos proxy available'));
  }

  // Execute write operation
  executeWriteOperation(this, 'insert', ns, ops, options, callback);
}

解决方案:

请重新启动您的 mongodb 和 MongoDB 罗盘,为了安全起见,您应该可以在没有任何错误。