.populate()

Set the `populates` key for this query.

> Used for populating associations.

@param {String|Array} key, the key to populate or array of string keys
@returns {Query}
330562
function(keyName, subcriteria) {

    assert(this._wlQueryInfo.method === 'find' || this._wlQueryInfo.method === 'findOne' || this._wlQueryInfo.method === 'stream', 'Cannot chain `.populate()` onto the `.'+this._wlQueryInfo.method+'()` method.  (In fact, this shouldn\'t even be possible!  So the fact that you are seeing this message at all is, itself, likely due to a bug in Waterline.)');

    // Backwards compatibility for arrays passed in as `keyName`.
    if (_.isArray(keyName)) {
      console.warn(
        'Deprecation warning: `.populate()` no longer accepts an array as its first argument.\n'+
        'Please use separate calls to `.populate()` instead.  Or, alternatively, instead of\n'+
        'using `.populate()`, you can choose to call `.find()`, `.findOne()` or `.stream()`\n'+
        'with a dictionary (plain JS object) as the second argument, where each key is the\n'+
        'name of an association, and each value is either:\n'+
        ' • true  (for singular aka "model" associations), or\n'+
        ' • a criteria dictionary (for plural aka "collection" associations)\n'+
        '(Interpreting this usage the original way for you this time...)\n'
      );
      var self = this;
      _.each(keyName, function(populate) {
        self.populate(populate, subcriteria);
      });
      return this;
    }//-•

    // Verify that we're dealing with a semi-reasonable string.
    // (This is futher validated)
    if (!keyName || !_.isString(keyName)) {
      throw new Error('Invalid usage for `.populate()` -- first argument should be the name of an assocation.');
    }

    // If this is the first time, make the `populates` query key an empty dictionary.
    if (_.isUndefined(this._wlQueryInfo.populates)) {
      this._wlQueryInfo.populates = {};
    }

    // Then, if subcriteria was specified, use it.
    if (!_.isUndefined(subcriteria)){
      this._wlQueryInfo.populates[keyName] = subcriteria;
    }
    else {
      // (Note: even though we set {} regardless, even when it should really be `true`
      // if it's a singular association, that's ok because it gets silently normalized
      // in FS2Q.)
      this._wlQueryInfo.populates[keyName] = {};
    }

    return this;
  }
685050
function (key) {
        var index = this.indexOfKey(key);

        if (index >= 0) {
            return this.slot.values[index];
        }

        error(ERROR_KEY_NOT_FOUND);
    }
505692
function(key) {
      var that = this;

      if (!this._key || !key) {
        return Promise.reject(new Error('No unique key specified'));
      }

      var props = {};
      props[this._key] = key;

      return this._dbApi.find(props).then(function(docs) {
        return that._readDoc(docs[0]);
      });
    }
135797
def load(key, options = {})
      @stack.each do |s|
        value = s.load(key, options)
        return value if value != nil
      end
      nil
    end
98206
function getset(key, value, req) {
  var val = this.getKey(key, req);
  this.setKey(key, value, undefined, undefined, undefined, req);
  return val || null;
}
1367536
function (key) {
                this.all(function(a) {
                    a.push(key)
                
                    var _set = {}
                    _set[this.key] = JSON.stringify(a)
                    storage.set(_set)
                })  
            }
735227
function hmget(key /* field-1, field-N, req */) {
  var args = slice.call(arguments, 1)
    , req = typeof args[args.length - 1] === 'object'
        ? args.pop() : null
    , val = this.getKey(key, req)
    , value
    , list = []
    , i;
  for(i = 0;i < args.length;i++) {
    if(!val) {
      list.push(null);
      continue;
    }
    value = val.getKey(args[i])
    list.push(value !== undefined ? value : null);
  }
  return list;
}
35277
function (key) {
                        key = _value(key);

                        if (angular.isArray(key)) {
                            key.map(this._removeItem, this);
                        } else {
                            this._removeItem(key);
                        }

                        return this;
                    }
178562
function(key){
                            if ($scope.node.type() === 'object')
                                delete $scope.json[key];
                            else if ($scope.node.type() === 'array')
                                $scope.json.splice(key, 1);
                            $scope.refresh();
                        }
939047
@Transactional(readOnly = true)
    public Object load(Object key) {
        List<T> results = getJdbcTemplate().query(
                getSelectSql(), getRowMapper(), getPrimaryKeyComponents(key));
        return results.size() == 0 ? null : results.get(0);
    }
639024
function move(key, index, req) {
  var val = this.getKey(key)
    , db = this.store.getDatabase(index, this.options);
  //console.dir(val);
  if(!val || db.keyExists(key)) return 0;
  db.setKey(key, val);
  this.delKey(key);
  return 1;
}
296257
protected static Object fetch(String key) {
        List valuesArray = (List) fetchObject(key);
        return valuesArray.get(RandomUtils.nextInt(valuesArray.size()));
    }
1050384
function(key, value){
    var c = getCache(this.ns)

    // set({foo: "bar"})
    if(arguments.length === 1 && typeof key === "object") {
      Object.keys(key).forEach(function(k){
        c[k] = key[k]
      }, this)
    }

    // set("foo", "bar")
    else {
      c[key] = value
    }

    return setCache(this.ns, c)
  }
608141
function( key ) {

    if( this.data[ key ] == null ) {
      return this.data[ key ]
    }

    if( Array.isArray( this.data[ key ] ) ) {
      return this.data[ key ].map( function( prop ) {
        return prop.clone()
      })
    } else {
      return this.data[ key ].clone()
    }

  }
1201878
function( key, info, callback ){
    this._run("update " + this.infoTable + " set info = '" + JSON.stringify(info) + "' where id = '"+key+":info'", function(err){
      if ( err ){
        callback('Key Not Found ' + key, null);
      } else {
        callback(null, true);
      }
    });
  }
765020
function( collectionID, key ) {
            collectionID = collectionID.toLowerCase();

            var deferred = q.defer();
            schemaSyncer.prepCollection(collectionID)
            .then( function() {
                sqliteObj.find( collectionID, {'_id': key}, false, 1 ).then(
                    // success
                    function(r) {
                        if ( r && r.length > 0 ) {
                            var firstElement = r[0];
                            if ( isValue(firstElement[key]) ) {
                                var value = firstElement[key];
                                deferred.resolve(value);
                            } else {
                                deferred.resolve(firstElement);
                            }
                        }
                        return deferred.resolve(null);
                    },

                    // failure
                    function(e) {
                        return q.reject(e);
                    }
                );
            });

            return deferred.promise;
        }
440057
function(key) {
          if (capacity < Number.MAX_VALUE) {
            var lruEntry = lruHash[key];

            if (!lruEntry) return;

            refresh(lruEntry);
          }

          return data[key];
        }