Right now, clicking on a service (ie, Datastore) in the docs brings me to a page that has a brief overview and then the stuff that happens to be at the top level (like... int and double).
Can we restructure this a smidge?
- Move
double and int somewhere else (at least in the docs?)
On this page, I'm really not looking for such a low-level detail, I'm looking for high-level stuff. If I want to get an idea of how to store special types, I'd be looking for a like to "Types" or something along those lines.
- The brief overview is fine, but it's bascially a
301 in that it says "you really want the dataset result... take a look at that". Can we make this act as a more friendly and (somewhat) comprehensive overview? Basically "here's the typical use case for [service], and how you write code to do it".
For example, with Datastore:
"""
The gcloud.datastore object gives you some convenience methods, as well as exposes a dataset function. This will allow you to create a dataset, which is the object from which you will interact with the Google Cloud Datastore.
The basic flow is:
-
Establish a connection to Cloud Datastore:
var gcloud = require('gcloud')({
projectId: 'grape-spaceship-123',
keyFilename: '/path/to/keyfile.json' // You can get this from the cloud console
});
var datastore = gcloud.datastore;
var dataset = datastore.dataset();
(Now that you have a dataset reference, take a look at the [link to dataset docs])
-
Add a TodoItem entity (if you don't know what an entity is, click here [link to entity concept on cloud.google.com]):
var key = dataset.Key('TodoItem');
var data = {title: "Buy milk", due: new Date('Tue May 12 2015 15:30:00 GMT-0400 (EDT)')};
dataset.save({key: key, data: data}, function(err) {
if (err) {
console.log("Uh oh, something went wrong:", err);
} else {
console.log("Todo item saved:", key.path); // ['TodoItem', 5669468231434240]
});
-
Retrieve your entity by it's key (if you don't know what a key is, click here [link to key concept on cloud.google.com]):
var key = dataset.key(['TodoItem', 5669468231434240]);
dataset.get(key, function(err, entity) {
if (err) {
console.log("Uh oh, something went wrong:", err);
} else {
console.log("Your entity is:", entity);
});
The other things you might want to do are:
- Run queries ("Give me all TodoItems due tomorrow"): [link to query docs]
- Do multiple operations in one atomic group: [link to transactions docs]
"""
(And remember -- these code snippets must be tested so that if our code would break them, the tests fail. We can't have docs out there that don't work...)
autoAckdemonstration)Right now, clicking on a service (ie, Datastore) in the docs brings me to a page that has a brief overview and then the stuff that happens to be at the top level (like...
intanddouble).Can we restructure this a smidge?
doubleandintsomewhere else (at least in the docs?)On this page, I'm really not looking for such a low-level detail, I'm looking for high-level stuff. If I want to get an idea of how to store special types, I'd be looking for a like to "Types" or something along those lines.
301in that it says "you really want thedatasetresult... take a look at that". Can we make this act as a more friendly and (somewhat) comprehensive overview? Basically "here's the typical use case for [service], and how you write code to do it".For example, with Datastore:
"""
The
gcloud.datastoreobject gives you some convenience methods, as well as exposes adatasetfunction. This will allow you to create adataset, which is the object from which you will interact with the Google Cloud Datastore.The basic flow is:
Establish a connection to Cloud Datastore:
(Now that you have a
datasetreference, take a look at the [link to dataset docs])Add a
TodoItementity (if you don't know what an entity is, click here [link to entity concept on cloud.google.com]):Retrieve your entity by it's key (if you don't know what a key is, click here [link to key concept on cloud.google.com]):
The other things you might want to do are:
"""
(And remember -- these code snippets must be tested so that if our code would break them, the tests fail. We can't have docs out there that don't work...)