anchor.diff:            _collectionHistory.find(beforeSelector).toList(),
             _collectionHistory.find(afterSelector).toList()]);})
         .then((results) {
  -
             before = new Set.from(results[0].map((d) => d['_id']));
             after = new Set.from(results[1].map((d) => d['_id']));
  -
             diff = [];
   
             beforeOrAfter.forEach((record) {
  
positive.code:               });
              }
            });
  
            return diff;
        });
    }
  
negative.code:     return mp;
    }
  
    /**
     * Returns data and version of this data. The following approach is used to
     * ensure consistency: 1. obtain version; 2. obtain data; 3. obtain version
     * again, if it differs from previously obtained version, go to step 2,
     * otherwise return data and version.
     */
    Future<Map> data() {
      Map selector = _selectorList.isEmpty ? {} : {AND: _selectorList};
      List data;
      int version;
      Function getDataAndVersion;
      getDataAndVersion = (_) {
        return _collection.find(selector).toList().then((d) {
          data = d;
          return _maxVersion;
        }).then((int v) {
          if(v == version){
            return {'data': data, 'version': version};
          } else {
            version = v;
            return getDataAndVersion();
          }
        });
      };
      return _maxVersion.then((v) {version=v;}).then(getDataAndVersion);
    }
  
    Future add(num _id, Map data, String author) {
  