self.collectionKey is correct here
12094
function (item, req, eachReq, res, next) {
          eachReq.item = item;
          eachReq[indexKey] = index;
          index++;
          next();
        }
1155203
def get_collection_in_tower(self, key):
        
        new = tf.get_collection(key)
        old = set(self.original.get(key, []))
        # persist the order in new
        return [x for x in new if x not in old]
664369
function _setCollectionFrom(COLLECTION) {
	  _export(_export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
	      var mapFn = arguments[1];
	      var mapping, A, n, cb;
	      _aFunction(this);
	      mapping = mapFn !== undefined;
	      if (mapping) _aFunction(mapFn);
	      if (source == undefined) return new this();
	      A = [];
	      if (mapping) {
	        n = 0;
	        cb = _ctx(mapFn, arguments[2], 2);
	        _forOf(source, false, function (nextItem) {
	          A.push(cb(nextItem, n++));
	        });
	      } else {
	        _forOf(source, false, A.push, A);
	      }
	      return new this(A);
	    } });
	}
513161
def _collection(self):
        
        old_sort_limits_and_len_mode = None if self._sort_limits is None else self._sort_limits.copy(), self._len_mode
        old_sorts = None if self._sort is None else self._sort.copy(),\
                    None if self._sort_by_sortedset is None else self._sort_by_sortedset.copy()
        try:
            if self.stored_key and not self._stored_len:
                if self._len_mode:
                    self._len = 0
                    self._len_mode = False
                self._sort_limits = {}
                return []

            # Manage sort desc added by original `__getitem__` when we sort by score
            if self._sort_by_sortedset and self._sort and self._sort.get('desc'):
                self._sort = None
                self._sort_by_sortedset['desc'] = not self._sort_by_sortedset.get('desc', False)

            return super(ExtendedCollectionManager, self)._collection
        finally:
            self._sort_limits, self._len_mode = old_sort_limits_and_len_mode
            self._sort, self._sort_by_sortedset = old_sorts
684264
public static <K, V> Collection<K> addAllKeysTo(Map<K, V> map, Collection<K> targetCollection)
    {
        MapIterate.forEachKey(map, CollectionAddProcedure.on(targetCollection));
        return targetCollection;
    }
153886
@Override
  public boolean isInstanceOf(KbCollection collection, Context context) {
    return wrapped().isInstanceOf(collection, context);
  }
702949
def ensure_index(self, key, unique=False):
        
        return self.collection.ensure_index(key, unique=unique)
166515
function (connectionName, collectionName, obj, cb) {
        if (_.isObject(obj)) {
            try {
                var modelInstance = new this._model(obj);
                return cb(null, modelInstance);
            }
            catch (err) {
                return cb(err, null);
            }
        }
    }
82202
function registerCollectionCommand (config, itemType, collectionPath, options = {}) {
  let nodeType = options.nodeType || itemType
  config.addCommand(`insert-${itemType}`, AddEntityCommand, {
    type: nodeType,
    collection: collectionPath,
    commandGroup: 'add-entity',
    metadataOnly: true
  })
  if (options.keyboardShortcut) {
    config.addKeyboardShortcut(options.keyboardShortcut, { command: `add-${itemType}` })
  }
}
1046627
def extend(self, collection):
        
        if type(collection) is list:
            if self._col_dict is None and self._col_list is None:
                self._col_list = collection
            else:
                self._col_list += collection
            self._sync_list_to_dict(collection)
        elif type(collection) is dict:
            if self._col_dict is None and self._col_list is None:
                self._col_dict = collection
                self._col_list = collection.values()
            else:
                for key, value in collection.items():
                    self._set_key(key, value)
        else:
            raise NotImplementedError()
195350
function(collection, options, cb) {
    var ids = [];
    var keys = _.isFunction(collection.url) ? collection.url() : collection.url;
    keys += options.keys;
    debug('findKeys', keys);
    this.store().getItem(keys, function(err, data) {
      if (data) ids.push(keys);
      cb(null, ids);
    });
  }
858329
function(next) {
      self.storage.init(function(error, collections) {
        if (error) {
          return next(error);
        }
        self.collections = collections;
        next();
      });
    }
657696
function getCollectionsCompact(forEntity, includeNew) {
  let associations = forEntity.getMeta().fetch('associations');
  let collections  = {};

  Object.getOwnPropertyNames(associations).forEach(index => {
    let association = associations[index];

    if (association.type !== 'collection') {
      return;
    }

    collections[index] = [];
    if (!Array.isArray(forEntity[index])) {
      return;
    }

    forEntity[index].forEach(entity => {
      if (typeof entity === 'number') {
        collections[index].push(entity);

        return;
      }

      if (!(entity instanceof Entity)) {
        return;
      }

      if (entity.getId()) {
        collections[index].push(entity.getId());

        return;
      }

      if (includeNew) {
        collections[index].push(entity);

        return;
      }
    });
  });

  return collections;
}
1043127
def put(self, key, value):
    '''
    '''
    if value is None:
      self.delete(key)
    else:
      self._collection(key)[key] = value
1026880
function isCollection(obj) {
  if (isPattern(obj)) {
    return false;
  }
  return Object.keys(obj).some(childKey => isPattern(obj[childKey]));
}
377205
function sortCollectionByKey(col, isDESC) {
  col.sort(function(a, b) {
    return getKeyLen(a) - getKeyLen(b);
  });

  if (isDESC) col.reverse();

  return col;
}
499423
private boolean isReadOnlyKey(Collection.Key key) {

	return (key.equals(KeyConstants._java) || key.equals(KeyConstants._separator) || key.equals(KeyConstants._os) || key.equals(KeyConstants._coldfusion)
		|| key.equals(KeyConstants._lucee));
    }