v0.37.0
Updating
$ npm install [email protected]
Hello, Bigtable!
Cloud Bigtable is Google's NoSQL Big Data database service. It's the same database that powers many core Google services, including Search, Analytics, Maps, and Gmail.
See our Bigtable API documentation for more examples.
var gcloud = require('gcloud');
// Authorizing on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authorization section above).
var bigtable = gcloud.bigtable({
zone: 'us-central1-b',
cluster: 'my-cluster'
});
// Create a table.
bigtable.createTable('prezzy', function(err, table) {});
// Create a column family within your table.
var table = bigtable.table('prezzy');
table.createFamily('follows', function(err, family) {});
// Update a row within your table.
var row = table.row('gwashington');
row.save('follows:alincoln', 1, function(err) {
if (err) {
// Error handling omitted.
}
row.get('follows:alincoln', function(err, data) {
if (err) {
// Error handling omitted.
}
// data = {
// follows: {
// alincoln: [
// {
// value: 1
// }
// ]
// }
// }
});
});
⚠️ Breaking Changes
Datastore: Transaction objects
Datastore Transactions are now their own custom type. Previously, operations have been blanketed by an "all-in-one" API. This led to some confusion about which steps were taking place behind the scenes; especially in the case of an error-- e.g., which part failed? See the example below for the differences.
Before
datastore.runInTransaction(function(transaction, done) {
transaction.save({
key: key,
data: { value: true }
});
done();
}, function(err) {
// Where is this error coming from?
});
After
var transaction = datastore.transaction();
transaction.run(function(err) {
if (err) {
// Error handling omitted.
}
transaction.save({
key: key,
data: { value: true }
});
transaction.commit(function(err) {
if (!err) {
// Transaction committed successfully.
}
});
});
Storage: Custom encryption keys property renamed
If you've been using custom encryption keys with a File
object, take note of these changes to the API:
bucket.upload('./my-file.zip', {
- key: 'my-custom-encryption-key'
+ encryptionKey: 'my-custom-encryption-key'
}, function() {...});
var file = bucket.file('my-file.zip', {
- key: 'my-custom-encryption-key'
+ encryptionKey: 'my-custom-encryption-key'
});
- file.setKey('my-custom-encryption-key');
+ file.setEncryptionKey('my-custom-encryption-key');
Features
- BigQuery (#1379, #1380): Support AVRO files.
- Logging (#1352, #1374): Native types
Date
,Error
, andRegExp
are now stringified when writing a log entry. - Storage (#1408): Allow using a custom domain name when creating signed resources. (Thanks, @AVVS!)
- Storage (#1395, #1416): Support
gs://
locations infile.copy()
andfile.move()
. (Thanks, @zbjornson!)
Fixes
A lot of documentation fixes were caught by @kevinresol. Thanks for the help, Kevin!
Thank you!
If you catch any regressions, please open an issue. See the Contributing guide for how to get started.