anchor.diff:        m["errmsg"] = errorMessage;
   
         result.completeError(m);
  -    } else if (firstRepliedDocument['ok'] == 1.0 &&
  -        firstRepliedDocument['err'] == null) {
  +    } else if (documentIsNotAnError(firstRepliedDocument)) {
         result.complete(firstRepliedDocument);
       } else {
         result.completeError(firstRepliedDocument);
  
positive.code:     if (writeConcern == null) {
        writeConcern = _writeConcern;
      }
      if (writeConcern == WriteConcern.ERRORS_IGNORED) {
        return new Future.value({'ok': 1.0});
      } else {
  
negative.code:   Db._authDb(this.databaseName);
    ServerConfig _parseUri(String uriString) {
      var uri = Uri.parse(uriString);
  
      if (uri.scheme != 'mongodb') {
        throw new MongoDartError(
            'Invalid scheme in uri: $uriString ${uri.scheme}');
      }
  
      var serverConfig = new ServerConfig();
      serverConfig.host = uri.host;
      serverConfig.port = uri.port;
  
      if (serverConfig.port == null || serverConfig.port == 0) {
        serverConfig.port = MONGO_DEFAULT_PORT;
      }
  
      if (uri.userInfo.isNotEmpty) {
        var userInfo = uri.userInfo.split(':');
  
        if (userInfo.length != 2) {
          throw new MongoDartError(
              'Invalid format of userInfo field: $uri.userInfo');
        }
  
        serverConfig.userName = userInfo[0];
        serverConfig.password = userInfo[1];
      }
  
      if (uri.path.isNotEmpty) {
        databaseName = uri.path.replaceAll('/', '');
      }
  
      uri.queryParameters.forEach((String queryParam, String value) {
        if (queryParam == _UriParameters.authMechanism) {
          selectAuthenticationMechanism(value);
        }
  
        if (queryParam == _UriParameters.authSource) {
          authSourceDb = new Db._authDb(value);
        }
      });
  
      return serverConfig;
    }
  
    void selectAuthenticationMechanism(String authenticationSchemeName) {
      if (authenticationSchemeName == ScramSha1Authenticator.name) {
        _authenticationScheme = AuthenticationScheme.SCRAM_SHA_1;
      } else if (authenticationSchemeName == MongoDbCRAuthenticator.name) {
        _authenticationScheme = AuthenticationScheme.MONGODB_CR;
      } else {
        throw new MongoDartError(
            "Provided authentication scheme is not supported : $authenticationSchemeName");
      }
    }
  
  