model-thin-gcloud-datastore v1.2.0
model-thin-gcloud-datastore
A Google Cloud Datastore storage adapter for the model-thin
data layer, using the gcloud-node library behind the scenes.
installation
Install alongside model-thin
via npm install model-thin-gcloud-datastore
, or as a dependency:
dependencies: {
"model-thin": ">=0.4.0",
"model-thin-gcloud-datastore": "^1.2.0"
}
usage and configuration
var datastore = require('model-thin-gcloud-datastore');
Before use the adapter needs to be configured with your project's ID:
datastore.configure({
projectId: 'my-project'
});
A namespace
and apiEndpoint
property can also be provided on the config object to further customize the adapter.
If not running on Google Compute Engine, additional credentials need to be provided. See the Authorization section of the gcloud-node
readme for instructions.
Once configured, the adapter can be selected according to the model-thin
adapter API.
Check out the query
method for a look at how passed query options are utilized, and see the datastore query docs for the expected values.