Skip to content

Latest commit

 

History

History
 
 

datastore

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Google Cloud Platform logo

Google Cloud Datastore Node.js Samples

Build

Cloud Datastore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. While the Cloud Datastore interface has many of the same features as traditional databases, as a NoSQL database it differs from them in the way it describes relationships between data objects.

Table of Contents

Setup

  1. Read Prerequisites and How to run a sample first.

  2. Install dependencies:

    With npm:

    npm install
    

    With yarn:

    yarn install
    

Samples

Tasks

View the documentation or the source code.

Usage: node tasks.js --help

Commands:
  new <description>  Adds a task with a description <description>.
  done <taskId>      Marks the specified task as done.
  list               Lists all tasks ordered by creation time.
  delete <taskId>    Deletes a task.

Options:
  --version  Show version number                                                                               [boolean]
  --help     Show help                                                                                         [boolean]

Examples:
  node tasks.js new "Buy milk"  Adds a task with description "Buy milk".
  node tasks.js done 12345      Marks task 12345 as Done.
  node tasks.js list            Lists all tasks ordered by creation time
  node tasks.js delete 12345    Deletes task 12345.

For more information, see https://cloud.google.com/datastore/docs

Concepts

View the [documentation][concepts_1_docs] or the [source code][concepts_1_code].[concepts_1_docs]: https://cloud.google.com/datastore/docs/concepts/entities [concepts_1_code]: concepts.js

Errors and Error Handling

View the [documentation][error_2_docs] or the [source code][error_2_code].

Usage: node error.js [error_2_docs]: https://cloud.google.com/datastore/docs/concepts/errors [error_2_code]: error.js

Running the tests

  1. Set the GCLOUD_PROJECT and GOOGLE_APPLICATION_CREDENTIALS environment variables.

  2. Run the tests:

    With npm:

    npm test
    

    With yarn:

    yarn test