docs: 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);
                      }