anchor.diff:        bool sparse,
         bool background,
         bool dropDups,
  -      String name}) {
  -    return new Future.sync(() {
  -      keys = _setKeys(key, keys);
  -      return collection(collectionName).getIndexes().then((indexInfos) {
  -        if (name == null) {
  -          name = _createIndexName(keys);
  -        }
  -        if (indexInfos.any((info) => info['name'] == name)) {
  -          return new Future.value({'ok': 1.0, 'result': 'index preexists'});
  -        }
  -        return createIndex(collectionName,
  -            keys: keys,
  -            unique: unique,
  -            sparse: sparse,
  -            background: background,
  -            dropDups: dropDups,
  -            name: name);
  -      });
  -    });
  +      String name}) async {
  +    keys = _setKeys(key, keys);
  +    var indexInfos = await collection(collectionName).getIndexes();
  +
  +    if (name == null) {
  +      name = _createIndexName(keys);
  +    }
  +
  +    if (indexInfos.any((info) => info['name'] == name)) {
  +      return {'ok': 1.0, 'result': 'index preexists'};
  +    }
  +
  +    var createdIndex = await createIndex(collectionName,
  +        keys: keys,
  +        unique: unique,
  +        sparse: sparse,
  +        background: background,
  +        dropDups: dropDups,
  +        name: name);
  +
  +    return createdIndex;
     }
   
     Future _getAcknowledgement({WriteConcern writeConcern}) {
  
positive.code:   }
  
    /// Analogue to shell's `show dbs`. Helper for `listDatabases` mongodb command.
    Future<List> listDatabases() {
      return executeDbCommand(
          DbCommand.createQueryAdminCommand({"listDatabases": 1})).then((val) {
        var res = [];
        for (var each in val["databases"]) {
          res.add(each["name"]);
        }
        return new Future.value(res);
      });
    }
  
    Stream<Map> _listCollectionsCursor([Map filter = const {}]) {
  
negative.code:       selector['name'] = name;
        MongoInsertMessage insertMessage = new MongoInsertMessage(
            '$databaseName.${DbCommand.SYSTEM_INDEX_COLLECTION}', [selector]);
        await executeMessage(insertMessage, _writeConcern);
        return getLastError();
      });
    }
  