<commit_before># $goKey

The `$goKey` method has only a single required parameter, a `keyName`, which is a string, referencing a specific location
in your GoInstant applications data structure.  It returns a [GoAngular Model](./model/index.md).

## Methods

- ###### **$goKey(keyName)**
- ###### **$goKey(keyName, roomName)**


## Parameters

| keyName |
|:---|
| Type: [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String). |
| The name of the key to be referenced. [Naming restrictions apply.](Naming restrictions apply) A leading forward-slash ('/') is implied, (e.g. 'foo/bar' is the same as '/foo/bar'). |

| roomName |
|:---|
| Type: [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String). |
| The name of the room to which your key belongs. This room will be joined automatically. |

## Returns

| [GoAngular Model](./model/index.md) |
| :--|
| Type: [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) |
| A new model, with methods for retrieving, manipulating and persisting data. |

## Example

Create a model for a single todo, relative to a collection of todos:

```js
angular.module('yourApp').controller('aCtrl', function($scope, $goKey) {
  $scope.todos.$goKey('todos').$sync();
  $scope.todos.$on('ready', function() {
    var todoOne = $scope.todos.$key('todo_1');
    todoOne.$key('description').$set('a new description');
  });
});<commit_msg>docs(key.md): Updating for consistencies sake<commit_after># $goKey

The `$goKey` method has only a single required parameter, a `keyName`, which is a string, referencing a specific location
in your GoInstant applications data structure.  It returns a [GoAngular Model](./model/index.md).

## Methods

- ###### **$goKey(keyName)**
- ###### **$goKey(keyName, roomName)**


## Parameters

| keyName |
|:---|
| Type: [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String). |
| The name of the key to be referenced. [Naming restrictions apply.](Naming restrictions apply) A leading forward-slash ('/') is implied, (e.g. 'foo/bar' is the same as '/foo/bar'). |

| roomName |
|:---|
| Type: [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String). |
| The name of the room to which your key belongs. This room will be joined automatically. |

## Returns

| [GoAngular Model](./model/index.md) |
| :--|
| Type: [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) |
| A new model, with methods for retrieving, manipulating and persisting data. |

## Example

Create a model for a single todo, relative to a collection of todos:

```js
angular.module('yourApp').controller('aCtrl', function($scope, $goKey) {
  $scope.todos = $goKey('todos');
  $scope.todos.$sync();
  $scope.todos.$on('ready', function() {
    var todoOne = $scope.todos.$key('todo_1');
    todoOne.$key('description').$set('a new description');
  });
});
{'fraction_non_alphanumeric': 0.17532894736842106, 'fraction_numerical': 0.0006578947368421052, 'mean_word_length': 4.499095840867993, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2303456', 'n_tokens_mistral': 991, 'n_tokens_neox': 958, 'n_words': 260}