Fortune.js adapter for GCloud Datastore - Highly Scalable NoSQL Database.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.vscode
lib
test
.codeclimate.yml
.eslintrc
.gitignore
.travis.yml
LICENSE
README.md
package-lock.json
package.json
run-test.sh
sample.js
yarn.lock

README.md

Code Climate Travis-CI

Fortune Google Cloud Datastore Adapter

This is a Google Cloud Datastore adapter for Fortune.

Usage

Install the fortune-datastore package from npm or yarn:

$ npm install fortune-datastore

or

$ yarn add fortune-datastore

Then use it with Fortune:

import fortune from 'fortune'
import datastoreAdapter from 'fortune-datastore'

const store = fortune({...},  {
  adapter: [
    datastoreAdapter,
    {
      projectId: 'my-gcp-project-id',
      keyFilename: 'gae_service_account_key.json',
      namespace: 'fortune-adapter-test'
    }
  ]
})

Adapter Options

Event Description
generateId Generate the id key on a new record. It must be a function that accepts one argument, the record type, and returns a unique string or number. Optional.
projectId The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.
keyFilename Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option above is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.
namespace Namespace to isolate transactions to.

License

This software is licensed under the MIT License.