diff --git a/docs/common.md b/docs/common.md index c3bacf75d743..850867321aa4 100644 --- a/docs/common.md +++ b/docs/common.md @@ -24,6 +24,8 @@ * [common/util~format(template, args)](#module_common/util..format) * [common/util~noop()](#module_common/util..noop) * [common/util~handleResp(err, resp, body, callback)](#module_common/util..handleResp) + * [common/util~is(value, type)](#module_common/util..is) + * [common/util~toArray(object)](#module_common/util..toArray) #common/connection @@ -130,6 +132,8 @@ token.isExpired(); * [common/util~format(template, args)](#module_common/util..format) * [common/util~noop()](#module_common/util..noop) * [common/util~handleResp(err, resp, body, callback)](#module_common/util..handleResp) + * [common/util~is(value, type)](#module_common/util..is) + * [common/util~toArray(object)](#module_common/util..toArray) ##common/util~extend(from, to) @@ -205,3 +209,40 @@ Uniformly process an API response. - callback `function` - The callback function. **Scope**: inner function of [common/util](#module_common/util) + +##common/util~is(value, type) +Check if an object is of the given type. + +**Params** + +- value `*` - Value to compare to. +- type `string` - Type to check against object's value. + +**Scope**: inner function of [common/util](#module_common/util) +**Returns**: `boolean` +**Example** +```js +is([1, 2, 3], 'array'); +// true +``` + + +##common/util~toArray(object) +Convert an object into an array. + +**Params** + +- object `object` - Object to convert to an array. + +**Scope**: inner function of [common/util](#module_common/util) +**Returns**: `array` +**Example** +```js +function aFunction() { + return toArray(arguments); +} + +aFunction(1, 2, 3); +// [1, 2, 3] +``` + diff --git a/docs/datastore.md b/docs/datastore.md index 8b3781822bfd..e14a3d3b3e5c 100644 --- a/docs/datastore.md +++ b/docs/datastore.md @@ -4,14 +4,15 @@ * [datastore/dataset](#module_datastore/dataset) * [class: Dataset ⏏](#exp_module_datastore/dataset) - * [new Dataset(options)](#exp_new_module_datastore/dataset) + * [new Dataset([options])](#exp_new_module_datastore/dataset) * [datastore/dataset~conn](#module_datastore/dataset..conn) * [datastore/dataset~entity](#module_datastore/dataset..entity) * [datastore/dataset~pb](#module_datastore/dataset..pb) * [datastore/dataset~Query](#module_datastore/dataset..Query) * [datastore/dataset~Transaction](#module_datastore/dataset..Transaction) * [datastore/dataset~util](#module_datastore/dataset..util) - * [datastore/dataset.createQuery()](#module_datastore/dataset#createQuery) + * [datastore/dataset.key()](#module_datastore/dataset#key) + * [datastore/dataset.createQuery([namespace], kinds)](#module_datastore/dataset#createQuery) * [datastore/dataset.get()](#module_datastore/dataset#get) * [datastore/dataset.save()](#module_datastore/dataset#save) * [datastore/dataset.delete()](#module_datastore/dataset#delete) @@ -21,7 +22,7 @@ * [const: datastore/dataset~SCOPES](#module_datastore/dataset..SCOPES) * [datastore/entity](#module_datastore/entity) * [class: datastore/entity~Key](#module_datastore/entity..Key) - * [new datastore/entity~Key()](#new_module_datastore/entity..Key) + * [new datastore/entity~Key(options)](#new_module_datastore/entity..Key) * [class: datastore/entity~Int](#module_datastore/entity..Int) * [new datastore/entity~Int(val)](#new_module_datastore/entity..Int) * [int.get()](#module_datastore/entity..Int#get) @@ -32,12 +33,23 @@ * [datastore ⏏](#exp_module_datastore) * [datastore~entity](#module_datastore..entity) * [datastore.Dataset](#module_datastore.Dataset) - * [datastore.key()](#module_datastore.key) * [datastore.int()](#module_datastore.int) * [datastore.double()](#module_datastore.double) * [datastore/pb](#module_datastore/pb) * [module.exports ⏏](#exp_module_datastore/pb) * [const: datastore/pb~Path](#module_datastore/pb..Path) +* [datastore/query](#module_datastore/query) + * [class: Query ⏏](#exp_module_datastore/query) + * [new Query([namespace], kinds)](#exp_new_module_datastore/query) + * [datastore/query.filter(filter, value)](#module_datastore/query#filter) + * [datastore/query.hasAncestor(key)](#module_datastore/query#hasAncestor) + * [datastore/query.order(property)](#module_datastore/query#order) + * [datastore/query.groupBy(properties)](#module_datastore/query#groupBy) + * [datastore/query.select(fieldNames)](#module_datastore/query#select) + * [datastore/query.start(cursorToken)](#module_datastore/query#start) + * [datastore/query.end(cursorToken)](#module_datastore/query#end) + * [datastore/query.limit(n)](#module_datastore/query#limit) + * [datastore/query.offset(n)](#module_datastore/query#offset) * [datastore/transaction](#module_datastore/transaction) * [class: Transaction ⏏](#exp_module_datastore/transaction) * [new Transaction(conn, datasetId)](#exp_new_module_datastore/transaction) @@ -65,14 +77,15 @@ **Members** * [class: Dataset ⏏](#exp_module_datastore/dataset) - * [new Dataset(options)](#exp_new_module_datastore/dataset) + * [new Dataset([options])](#exp_new_module_datastore/dataset) * [datastore/dataset~conn](#module_datastore/dataset..conn) * [datastore/dataset~entity](#module_datastore/dataset..entity) * [datastore/dataset~pb](#module_datastore/dataset..pb) * [datastore/dataset~Query](#module_datastore/dataset..Query) * [datastore/dataset~Transaction](#module_datastore/dataset..Transaction) * [datastore/dataset~util](#module_datastore/dataset..util) - * [datastore/dataset.createQuery()](#module_datastore/dataset#createQuery) + * [datastore/dataset.key()](#module_datastore/dataset#key) + * [datastore/dataset.createQuery([namespace], kinds)](#module_datastore/dataset#createQuery) * [datastore/dataset.get()](#module_datastore/dataset#get) * [datastore/dataset.save()](#module_datastore/dataset#save) * [datastore/dataset.delete()](#module_datastore/dataset#delete) @@ -82,22 +95,23 @@ * [const: datastore/dataset~SCOPES](#module_datastore/dataset..SCOPES) -###new Dataset(options) +###new Dataset([options]) Intract with a dataset from the [Google Cloud Datastore](https://developers.google.com/datastore/). **Params** -- options `object` - - id `string` - Dataset ID. This is your project ID from the - Google Developers Console. +- \[options\] `object` + - projectId `string` - Dataset ID. This is your project ID from + the Google Developers Console. - keyFileName `string` - Full path to the JSON key downloaded from the Google Developers Console. + - namespace `string` - Namespace to isolate transactions to. **Example** ```js var dataset = new Dataset({ - id: 'my-project', + projectId: 'my-project', keyFileName: '/path/to/keyfile.json' }); ``` @@ -117,7 +131,7 @@ var dataset = new Dataset({ ###datastore/dataset~Query **Scope**: inner member of [datastore/dataset](#module_datastore/dataset) -**Type**: [module:datastore/query](#module_datastore/query) +**Type**: [datastore/query](#module_datastore/query) ###datastore/dataset~Transaction **Scope**: inner member of [datastore/dataset](#module_datastore/dataset) @@ -126,15 +140,50 @@ var dataset = new Dataset({ ###datastore/dataset~util **Scope**: inner member of [datastore/dataset](#module_datastore/dataset) **Type**: [module:common/util](module:common/util) + +###datastore/dataset.key() +Helper to create a Key object, scoped to the dataset's namespace by default. + +You may also specify a configuration object to define a namespace and path. + +**Example** +```js +var key; + +// Create a key from the dataset's namespace. +key = dataset.key('Company', 123); + +// Create a key from a provided namespace and path. +key = dataset.key({ + namespace: 'My-NS', + path: ['Company', 123] +}); +``` + -###datastore/dataset.createQuery() -Create a query from the current dataset to query the specified kinds. +###datastore/dataset.createQuery([namespace], kinds) +Create a query from the current dataset to query the specified kinds, scoped +to the namespace provided at the initialization of the dataset. + +**Params** -**Returns**: [module:datastore/query](#module_datastore/query) +- \[namespace\] `string` - Optional namespace. +- kinds `string` | `array` - Kinds to query. + +**Returns**: [datastore/query](#module_datastore/query) **Example** ```js -var query = dataset.createQuery(['Lion', 'Chimp']); -var zooQuery = dataset.createQuery('zoo', ['Lion', 'Chimp']); +var query; + +// If your dataset was scoped to a namespace at initialization, your query +// will likewise be scoped to that namespace. +query = dataset.createQuery(['Lion', 'Chimp']); + +// However, you may override the namespace per query. +query = dataset.createQuery('AnimalNamespace', ['Lion', 'Chimp']); + +// You may also remove the namespace altogether. +query = dataset.createQuery(null, ['Lion', 'Chimp']); ``` @@ -269,7 +318,7 @@ Scopes for Google Datastore access. * [datastore/entity](#module_datastore/entity) * [class: datastore/entity~Key](#module_datastore/entity..Key) - * [new datastore/entity~Key()](#new_module_datastore/entity..Key) + * [new datastore/entity~Key(options)](#new_module_datastore/entity..Key) * [class: datastore/entity~Int](#module_datastore/entity..Int) * [new datastore/entity~Int(val)](#new_module_datastore/entity..Int) * [int.get()](#module_datastore/entity..Int#get) @@ -282,15 +331,17 @@ Scopes for Google Datastore access. **Members** * [class: datastore/entity~Key](#module_datastore/entity..Key) - * [new datastore/entity~Key()](#new_module_datastore/entity..Key) + * [new datastore/entity~Key(options)](#new_module_datastore/entity..Key) -###new datastore/entity~Key() +###new datastore/entity~Key(options) Build a Datastore Key object. **Params** -- ... `*` - Key descriptors. +- options `object` - Configuration object. + - ...path `*` - Key path. + - \[namespace\] `string` - Optional namespace. **Scope**: inner class of [datastore/entity](#module_datastore/entity) **Example** @@ -360,7 +411,6 @@ Retrieve the Integer value. * [datastore ⏏](#exp_module_datastore) * [datastore~entity](#module_datastore..entity) * [datastore.Dataset](#module_datastore.Dataset) - * [datastore.key()](#module_datastore.key) * [datastore.int()](#module_datastore.int) * [datastore.double()](#module_datastore.double) @@ -375,13 +425,6 @@ Retrieve the Integer value. var dataset = new datastore.Dataset(); ``` - -##datastore.key() -**Example** -```js -var key = dataset.key('Company', 123); -``` - ##datastore.int() **Example** @@ -406,6 +449,211 @@ to the proto file. **Scope**: inner constant of [datastore/pb](#module_datastore/pb) **Type**: `string` + +#datastore/query + +##class: Query ⏏ +**Members** + +* [class: Query ⏏](#exp_module_datastore/query) + * [new Query([namespace], kinds)](#exp_new_module_datastore/query) + * [datastore/query.filter(filter, value)](#module_datastore/query#filter) + * [datastore/query.hasAncestor(key)](#module_datastore/query#hasAncestor) + * [datastore/query.order(property)](#module_datastore/query#order) + * [datastore/query.groupBy(properties)](#module_datastore/query#groupBy) + * [datastore/query.select(fieldNames)](#module_datastore/query#select) + * [datastore/query.start(cursorToken)](#module_datastore/query#start) + * [datastore/query.end(cursorToken)](#module_datastore/query#end) + * [datastore/query.limit(n)](#module_datastore/query#limit) + * [datastore/query.offset(n)](#module_datastore/query#offset) + + +###new Query([namespace], kinds) +Build a Query object. Queries will generally be built with +{@linkcode module:datastore/dataset#createQuery} and ran via +{@linkcode module:datastore/dataset#runQuery}. + +*Reference: [http://goo.gl/Cag0r6](http://goo.gl/Cag0r6)* + +**Params** + +- \[namespace\] `string` - Namespace to query entities from. +- kinds `Array.` - Kinds to query. + +**Example** +```js +var query = new Query(['Lion', 'Chimp']); +var zooQuery = new Query('zoo', ['Lion', 'Chimp']); +``` + + +###datastore/query.filter(filter, value) +Datastore allows querying on properties. Supported comparison operators +are `=`, `<`, `>`, `<=`, and `>=`. "Not equal" and `IN` operators are +currently not supported. + +*To filter by ancestors, see {@linkcode module:datastore/query#hasAncestor}.* + +*Reference: [http://goo.gl/ENCx7e](http://goo.gl/ENCx7e)* + +**Params** + +- filter `string` - Property + Operator (=, <, >, <=, >=). +- value `*` - Value to compare property to. + +**Returns**: [datastore/query](#module_datastore/query) +**Example** +```js +// List all companies named Google that have less than 400 employees. +var companyQuery = query + .filter('name =', 'Google'); + .filter('size <', 400); + +// To filter by key, use `__key__` for the property name. Filter on keys +// stored as properties is not currently supported. +var keyQuery = query.filter('__key__ =', datastore.key('Company', 'Google')); +``` + + +###datastore/query.hasAncestor(key) +Filter a query by ancestors. + +*Reference: [http://goo.gl/1qfpkZ](http://goo.gl/1qfpkZ)* + +**Params** + +- key `datastore/entity~Key` - Key object to filter by. + +**Returns**: [datastore/query](#module_datastore/query) +**Example** +```js +var ancestoryQuery = query.hasAncestor(datastore.key('Parent', 123)); +``` + + +###datastore/query.order(property) +Sort the results by a property name ascendingly or descendingly. By default, +an ascending sort order will be used. + +*Reference: [http://goo.gl/mfegFR](http://goo.gl/mfegFR)* + +**Params** + +- property `string` - Optional operator (+, -) and property to order by. + +**Returns**: [datastore/query](#module_datastore/query) +**Example** +```js +// Sort by size ascendingly. +var companiesAscending = companyQuery.order('size'); + +// Sort by size descendingly. +var companiesDescending = companyQuery.order('-size'); +``` + + +###datastore/query.groupBy(properties) +Group query results by a list of properties. + +**Params** + +- properties `array` - Properties to group by. + +**Returns**: [datastore/query](#module_datastore/query) +**Example** +```js +var groupedQuery = companyQuery.groupBy(['name', 'size']); +``` + + +###datastore/query.select(fieldNames) +Retrieve only select properties from the matched entities. + +*Reference: [Projection Queries](http://goo.gl/EfsrJl)* + +**Params** + +- fieldNames `array` - Properties to return from the matched entities. + +**Returns**: [datastore/query](#module_datastore/query) +**Example** +```js +// Only retrieve the name and size properties. +var selectQuery = companyQuery.select(['name', 'size']); +``` + + +###datastore/query.start(cursorToken) +Set a starting cursor to a query. + +*Reference: [http://goo.gl/WuTGRI](http://goo.gl/WuTGRI)* + +**Params** + +- cursorToken `string` - The starting cursor token. + +**Returns**: [datastore/query](#module_datastore/query) +**Example** +```js +var cursorToken = 'X'; + +// Retrieve results starting from cursorToken. +var startQuery = companyQuery.start(cursorToken); +``` + + +###datastore/query.end(cursorToken) +Set an ending cursor to a query. + +*Reference: [http://goo.gl/WuTGRI](http://goo.gl/WuTGRI)* + +**Params** + +- cursorToken `string` - The ending cursor token. + +**Returns**: [datastore/query](#module_datastore/query) +**Example** +```js +var cursorToken = 'X'; + +// Retrieve results limited to the extent of cursorToken. +var endQuery = companyQuery.end(cursorToken); +``` + + +###datastore/query.limit(n) +Set a limit on a query. + +*Reference: [http://goo.gl/f0VZ0n](http://goo.gl/f0VZ0n)* + +**Params** + +- n `number` - The number of results to limit the query to. + +**Returns**: [datastore/query](#module_datastore/query) +**Example** +```js +// Limit the results to 10 entities. +var limitQuery = companyQuery.limit(10); +``` + + +###datastore/query.offset(n) +Set an offset on a query. + +*Reference: [http://goo.gl/f0VZ0n](http://goo.gl/f0VZ0n)* + +**Params** + +- n `number` - The offset to start from after the start cursor. + +**Returns**: [datastore/query](#module_datastore/query) +**Example** +```js +// Start from the 101st result. +var offsetQuery = companyQuery.offset(100); +``` + #datastore/transaction @@ -649,7 +897,7 @@ is provided to the callback function. **Params** -- query `Query` - Query object. +- query [datastore/query](#module_datastore/query) - Query object. - callback `function` - The callback function. **Example** diff --git a/docs/html/connection-Token.html b/docs/html/connection-Token.html index 89dd85e18f6d..fa51af0a06e2 100644 --- a/docs/html/connection-Token.html +++ b/docs/html/connection-Token.html @@ -96,6 +96,8 @@

  • get
  • +
  • key
  • +
  • runInTransaction
  • runQuery
  • @@ -556,7 +558,7 @@
    Example
    diff --git a/docs/html/connection.html b/docs/html/connection.html index f8e514ea3911..5b50a1696200 100644 --- a/docs/html/connection.html +++ b/docs/html/connection.html @@ -96,6 +96,8 @@

  • get
  • +
  • key
  • +
  • runInTransaction
  • runQuery
  • @@ -713,7 +715,7 @@
    Example
    diff --git a/docs/html/dataset.html b/docs/html/dataset.html index 26dea3bfa209..dcd93d5855bc 100644 --- a/docs/html/dataset.html +++ b/docs/html/dataset.html @@ -96,6 +96,8 @@

  • get
  • +
  • key
  • +
  • runInTransaction
  • runQuery
  • @@ -292,12 +294,12 @@

    - new require("datastore/dataset")(options) + new require("datastore/dataset")(options)

    - datastore/dataset.js, line 71 + datastore/dataset.js, line 72
    @@ -356,6 +358,13 @@

    + + optional + + + + + @@ -379,7 +388,7 @@

    - id + projectId @@ -395,8 +404,8 @@

    -

    Dataset ID. This is your project ID from the - Google Developers Console.

    +

    Dataset ID. This is your project ID from + the Google Developers Console.

    @@ -424,6 +433,29 @@

    + + + + namespace + + + + + +string + + + + + + + + + +

    Namespace to isolate transactions to.

    + + + @@ -476,7 +508,7 @@

    Example
    var dataset = new Dataset({
    -  id: 'my-project',
    +  projectId: 'my-project',
       keyFileName: '/path/to/keyfile.json'
     });
    @@ -840,7 +872,7 @@

    - datastore/dataset.js, line 250 + datastore/dataset.js, line 293
    @@ -1015,12 +1047,12 @@

    Example

    - createQuery(){module:datastore/query} + createQuery(namespace, kinds){module:datastore/query}

    - datastore/dataset.js, line 95 + datastore/dataset.js, line 139
    @@ -1031,7 +1063,8 @@

    -

    Create a query from the current dataset to query the specified kinds.

    +

    Create a query from the current dataset to query the specified kinds, scoped +to the namespace provided at the initialization of the dataset.

    @@ -1040,6 +1073,89 @@

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    namespace + + +string + + + + + + + optional + + + + + +

    Optional namespace.

    kinds + + +string +| + +array + + + + + + + + + + +

    Kinds to query.

    +
    @@ -1087,8 +1203,17 @@
    Example
    -
    var query = dataset.createQuery(['Lion', 'Chimp']);
    -var zooQuery = dataset.createQuery('zoo', ['Lion', 'Chimp']);
    +
    var query;
    +
    +// If your dataset was scoped to a namespace at initialization, your query
    +// will likewise be scoped to that namespace.
    +query = dataset.createQuery(['Lion', 'Chimp']);
    +
    +// However, you may override the namespace per query.
    +query = dataset.createQuery('AnimalNamespace', ['Lion', 'Chimp']);
    +
    +// You may also remove the namespace altogether.
    +query = dataset.createQuery(null, ['Lion', 'Chimp']);
    @@ -1105,7 +1230,7 @@

    - datastore/dataset.js, line 171 + datastore/dataset.js, line 214
    @@ -1187,7 +1312,7 @@

    - datastore/dataset.js, line 115 + datastore/dataset.js, line 158
    @@ -1256,6 +1381,95 @@

    Example
    +
    +
    +

    + + key() +

    + + +
    + datastore/dataset.js, line 103 +
    + +
    + + +
    +
    + + +
    +

    Helper to create a Key object, scoped to the dataset's namespace by default.

    +

    You may also specify a configuration object to define a namespace and path.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + +
    Example
    + + + +
    var key;
    +
    +// Create a key from the dataset's namespace.
    +key = dataset.key('Company', 123);
    +
    +// Create a key from a provided namespace and path.
    +key = dataset.key({
    +  namespace: 'My-NS',
    +  path: ['Company', 123]
    +});
    + + + +
    + + +

    @@ -1265,7 +1479,7 @@

    - datastore/dataset.js, line 218 + datastore/dataset.js, line 261

    @@ -1424,7 +1638,7 @@

    - datastore/dataset.js, line 189 + datastore/dataset.js, line 232
    @@ -1505,7 +1719,7 @@

    - datastore/dataset.js, line 152 + datastore/dataset.js, line 195
    @@ -1611,7 +1825,7 @@

    Example
    - Documentation generated by JSDoc 3.3.0-alpha9 on Thu Aug 21 2014 22:48:55 GMT-0400 (EDT) + Documentation generated by JSDoc 3.3.0-alpha9 on Tue Aug 26 2014 13:20:26 GMT-0400 (EDT)
    diff --git a/docs/html/entity-Double.html b/docs/html/entity-Double.html index 9798bf619acc..088ba53c782e 100644 --- a/docs/html/entity-Double.html +++ b/docs/html/entity-Double.html @@ -96,6 +96,8 @@

  • get
  • +
  • key
  • +
  • runInTransaction
  • runQuery
  • @@ -301,7 +303,7 @@

    - datastore/entity.js, line 146 + datastore/entity.js, line 145
    @@ -443,7 +445,7 @@

    - datastore/entity.js, line 155 + datastore/entity.js, line 154
    @@ -525,7 +527,7 @@

    - Documentation generated by JSDoc 3.3.0-alpha9 on Thu Aug 21 2014 22:48:55 GMT-0400 (EDT) + Documentation generated by JSDoc 3.3.0-alpha9 on Tue Aug 26 2014 13:20:26 GMT-0400 (EDT)
    diff --git a/docs/html/entity-Int.html b/docs/html/entity-Int.html index 46ff61511afb..993d04766fc6 100644 --- a/docs/html/entity-Int.html +++ b/docs/html/entity-Int.html @@ -96,6 +96,8 @@

  • get
  • +
  • key
  • +
  • runInTransaction
  • runQuery
  • @@ -301,7 +303,7 @@

    - datastore/entity.js, line 120 + datastore/entity.js, line 119
    @@ -443,7 +445,7 @@

    - datastore/entity.js, line 129 + datastore/entity.js, line 128
    @@ -525,7 +527,7 @@

    - Documentation generated by JSDoc 3.3.0-alpha9 on Thu Aug 21 2014 22:48:55 GMT-0400 (EDT) + Documentation generated by JSDoc 3.3.0-alpha9 on Tue Aug 26 2014 13:20:26 GMT-0400 (EDT)
    diff --git a/docs/html/entity-Key.html b/docs/html/entity-Key.html index ecfaf9db1210..59088d8ff047 100644 --- a/docs/html/entity-Key.html +++ b/docs/html/entity-Key.html @@ -96,6 +96,8 @@

  • get
  • +
  • key
  • +
  • runInTransaction
  • runQuery
  • @@ -296,12 +298,12 @@

    - new Key() + new Key(options)

    - datastore/entity.js, line 99 + datastore/entity.js, line 101
    @@ -327,6 +329,47 @@

    + Name + + + Type + + + + Description + + + + + + + + + options + + + + + +object + + + + + + + + + +

    Configuration object.

    + + + + + + + + @@ -341,6 +384,8 @@

    + + +

    Key path.

    + + + + + + + + + + + + + + + + + + +
    NameType
    path @@ -362,7 +407,43 @@

    repeatable -

    Key descriptors.

    namespace + + +string + + + + + + + optional + + + + + +

    Optional namespace.

    + @@ -448,7 +529,7 @@

    Example
    - Documentation generated by JSDoc 3.3.0-alpha9 on Thu Aug 21 2014 22:48:55 GMT-0400 (EDT) + Documentation generated by JSDoc 3.3.0-alpha9 on Tue Aug 26 2014 13:20:26 GMT-0400 (EDT)
    diff --git a/docs/html/entity.html b/docs/html/entity.html index a27e873e0e55..2cf1cffa0ba0 100644 --- a/docs/html/entity.html +++ b/docs/html/entity.html @@ -96,6 +96,8 @@

  • get
  • +
  • key
  • +
  • runInTransaction
  • runQuery
  • @@ -362,7 +364,7 @@

    Classes

    - Documentation generated by JSDoc 3.3.0-alpha9 on Thu Aug 21 2014 22:48:55 GMT-0400 (EDT) + Documentation generated by JSDoc 3.3.0-alpha9 on Tue Aug 26 2014 13:20:26 GMT-0400 (EDT)
    diff --git a/docs/html/global.html b/docs/html/global.html index b84dc6eafbe1..a9ca56fa2e3b 100644 --- a/docs/html/global.html +++ b/docs/html/global.html @@ -96,6 +96,8 @@

  • get
  • +
  • key
  • +
  • runInTransaction
  • runQuery
  • @@ -1015,7 +1017,7 @@

    - Documentation generated by JSDoc 3.3.0-alpha9 on Thu Aug 21 2014 22:48:55 GMT-0400 (EDT) + Documentation generated by JSDoc 3.3.0-alpha9 on Tue Aug 26 2014 13:20:26 GMT-0400 (EDT)
    diff --git a/docs/html/index.html b/docs/html/index.html index 906fc63dfdf9..1f6c0643d2b6 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -96,6 +96,8 @@

  • get
  • +
  • key
  • +
  • runInTransaction
  • runQuery
  • @@ -299,7 +301,7 @@

    - Documentation generated by JSDoc 3.3.0-alpha9 on Thu Aug 21 2014 22:48:55 GMT-0400 (EDT) + Documentation generated by JSDoc 3.3.0-alpha9 on Tue Aug 26 2014 13:20:26 GMT-0400 (EDT)
    diff --git a/docs/html/module-datastore.html b/docs/html/module-datastore.html index ed65f55eb3b7..3e2d24bd9fa9 100644 --- a/docs/html/module-datastore.html +++ b/docs/html/module-datastore.html @@ -96,6 +96,8 @@

  • get
  • +
  • key
  • +
  • runInTransaction
  • runQuery
  • @@ -441,7 +443,7 @@

    - datastore/index.js, line 73 + datastore/index.js, line 61
    @@ -519,81 +521,6 @@

    -
    - datastore/index.js, line 59 -
    - - - - -
    -
    - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - -
    Example
    - - - -
    var anInteger = dataset.int(7);
    - - - -
    - - - -
    -
    -

    - - staticmodule:datastore.key() -

    - -
    datastore/index.js, line 47
    @@ -653,7 +580,7 @@
    Example
    -
    var key = dataset.key('Company', 123);
    +
    var anInteger = dataset.int(7);
    @@ -676,7 +603,7 @@
    Example
    - Documentation generated by JSDoc 3.3.0-alpha9 on Thu Aug 21 2014 22:48:55 GMT-0400 (EDT) + Documentation generated by JSDoc 3.3.0-alpha9 on Tue Aug 26 2014 13:20:26 GMT-0400 (EDT)
    diff --git a/docs/html/module-storage.html b/docs/html/module-storage.html index 5f45378d6451..614b8d004b19 100644 --- a/docs/html/module-storage.html +++ b/docs/html/module-storage.html @@ -96,6 +96,8 @@

  • get
  • +
  • key
  • +
  • runInTransaction
  • runQuery
  • @@ -785,7 +787,7 @@
    Example
    - Documentation generated by JSDoc 3.3.0-alpha9 on Thu Aug 21 2014 22:48:55 GMT-0400 (EDT) + Documentation generated by JSDoc 3.3.0-alpha9 on Tue Aug 26 2014 13:20:26 GMT-0400 (EDT)
    diff --git a/docs/html/pb.html b/docs/html/pb.html index 4b931858cec6..cb1a630f03a8 100644 --- a/docs/html/pb.html +++ b/docs/html/pb.html @@ -96,6 +96,8 @@

  • get
  • +
  • key
  • +
  • runInTransaction
  • runQuery
  • @@ -398,7 +400,7 @@

    inner,constantPa
    - Documentation generated by JSDoc 3.3.0-alpha9 on Thu Aug 21 2014 22:48:55 GMT-0400 (EDT) + Documentation generated by JSDoc 3.3.0-alpha9 on Tue Aug 26 2014 13:20:26 GMT-0400 (EDT)
    diff --git a/docs/html/query.html b/docs/html/query.html index cab3e47cae4e..c3da3cd5ab99 100644 --- a/docs/html/query.html +++ b/docs/html/query.html @@ -2,7 +2,7 @@ - Class: module:datastore/query + Module: datastore/query @@ -96,6 +96,8 @@

  • get
  • +
  • key
  • +
  • runInTransaction
  • runQuery
  • @@ -270,7 +272,7 @@

    -

    Class: module:datastore/query

    +

    Module: datastore/query

    @@ -279,7 +281,7 @@

    Class: module:datastore/query<

    - module:datastore/query + datastore/query

    @@ -287,19 +289,17 @@

    - -

    - new module:datastore/query(namespace, kinds) + new require("datastore/query")(namespace, kinds)

    - datastore/query.js, line 40 + datastore/query.js, line 44
    @@ -452,6 +452,38 @@
    Example
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    @@ -480,7 +512,7 @@

    - datastore/query.js, line 218 + datastore/query.js, line 227

    @@ -613,7 +645,7 @@

    - datastore/query.js, line 83 + datastore/query.js, line 92
    @@ -783,7 +815,7 @@

    - datastore/query.js, line 153 + datastore/query.js, line 162
    @@ -912,7 +944,7 @@

    - datastore/query.js, line 106 + datastore/query.js, line 115
    @@ -1042,7 +1074,7 @@

    - datastore/query.js, line 238 + datastore/query.js, line 247
    @@ -1173,7 +1205,7 @@

    - datastore/query.js, line 258 + datastore/query.js, line 267
    @@ -1299,12 +1331,12 @@

    Example

    - order(order){module:datastore/query} + order(property){module:datastore/query}

    - datastore/query.js, line 129 + datastore/query.js, line 139
    @@ -1315,7 +1347,8 @@

    -

    Sort the results by a property name ascendingly or descendingly.

    +

    Sort the results by a property name ascendingly or descendingly. By default, +an ascending sort order will be used.

    Reference: http://goo.gl/mfegFR

    @@ -1347,7 +1380,7 @@

    - order + property @@ -1363,7 +1396,7 @@

    -

    Operator (+, -) + property to order by.

    +

    Optional operator (+, -) and property to order by.

    @@ -1418,7 +1451,7 @@

    Example
    // Sort by size ascendingly.
    -var companiesAscending = companyQuery.order('+size');
    +var companiesAscending = companyQuery.order('size');
     
     // Sort by size descendingly.
     var companiesDescending = companyQuery.order('-size');
    @@ -1438,7 +1471,7 @@

    - datastore/query.js, line 174 + datastore/query.js, line 183
    @@ -1569,7 +1602,7 @@

    - datastore/query.js, line 196 + datastore/query.js, line 205
    @@ -1708,7 +1741,7 @@

    Example
    - Documentation generated by JSDoc 3.3.0-alpha9 on Thu Aug 21 2014 22:48:55 GMT-0400 (EDT) + Documentation generated by JSDoc 3.3.0-alpha9 on Tue Aug 26 2014 13:20:26 GMT-0400 (EDT)
    diff --git a/docs/html/transaction.html b/docs/html/transaction.html index 0dfcb2c69dc6..7a3e9abc48d4 100644 --- a/docs/html/transaction.html +++ b/docs/html/transaction.html @@ -96,6 +96,8 @@

  • get
  • +
  • key
  • +
  • runInTransaction
  • runQuery
  • @@ -1921,7 +1923,7 @@

    -Query +module:datastore/query @@ -2279,7 +2281,7 @@

    Example
    - Documentation generated by JSDoc 3.3.0-alpha9 on Thu Aug 21 2014 22:48:55 GMT-0400 (EDT) + Documentation generated by JSDoc 3.3.0-alpha9 on Tue Aug 26 2014 13:20:26 GMT-0400 (EDT)
    diff --git a/docs/html/util.html b/docs/html/util.html index 1106fbf95596..64c404eca7b4 100644 --- a/docs/html/util.html +++ b/docs/html/util.html @@ -96,6 +96,8 @@

  • get
  • +
  • key
  • +
  • runInTransaction
  • runQuery
  • @@ -952,6 +954,159 @@

    + + + + +
    +
    +

    + + inneris(value, type){boolean} +

    + + +
    + common/util.js, line 191 +
    + +
    + + +
    +
    + + +
    +

    Check if an object is of the given type.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    value + + +* + + + + + +

    Value to compare to.

    type + + +string + + + + + +

    Type to check against object's value.

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + +
    Example
    + + + +
    is([1, 2, 3], 'array');
    +// true
    + + +
    @@ -1033,6 +1188,140 @@

    Example
    + + + + +
    +
    +

    + + innertoArray(object){array} +

    + + +
    + common/util.js, line 213 +
    + +
    + + +
    +
    + + +
    +

    Convert an object into an array.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    object + + +object + + + + + +

    Object to convert to an array.

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + +
    Example
    + + + +
    function aFunction() {
    +  return toArray(arguments);
    +}
    +
    +aFunction(1, 2, 3);
    +// [1, 2, 3]
    + + +
    @@ -1052,7 +1341,7 @@

    Example