0.1.2 • Published 9 years ago

gcloud-datastore-util v0.1.2

Weekly downloads
12
License
-
Repository
github
Last release
9 years ago

GCLOUD-DATASTORE-UTIL

NAME

gcloud-datastore-util - utility for Google Cloud Datastore

DESCRIPTION

This module exports a collection of common functionalities when using Google Cloud Datastore via gcloud module:

  1. Remove all entities of a given kind of a namespace.

Note that this module does not include the gcloud module, it must be required separately.

EXAMPLES

Remove all entities of a given kind of a namespace:

var config = {
  projectId: 'projectId',
  keyFilename: '/path/to/key/file.json',
  namespace: 'Namespace'
};
var dataset = require('gcloud').datastore.dataset(config);
var datastore = require('gcloud-datastore-util');
var kind = 'kind';

datastore.zero(dataset, kind, function (err, keys) {
  // Print the keys of all entities that were deleted.
  console.log(err || keys);
});

TEST

Install development dependencies:

$ npm install

Run test on every code change:

$ mocha --harmony --watch

AUTHORS

Chao Huang chao@realguess.net

SEE ALSO