Releases: lostpebble/pebblebed
v0.5.1 - Pebblebed.key()
Allow the basic functionality of only a string array, passed in to Pebblebed.key()
, to represent the key to be created. Previous functionality allowed an array but required Pebblebed models for the "Kind" parts of the key.
This was a bug and should have always been allowed.
v0.5.0 allocateIds
Added the ability to use the following syntax:
const keys = await TestModel.allocateIds(1);
This will return an array of keys that have unique (integer) ids assigned to them - allocated from the Google Cloud Datastore to ensure uniqueness.
You can also specify an array for ancestors as a second argument.
v0.4.1
Simple fix to allow creation of Schemas in typescript without passing in a generic type. Will help with gradually changing over to more strongly-typed schemas.
v0.4.0 : Updated syntax for excludeFromIndexes to match new Datastore library version
As per this issue in @google-cloud/datastore library: googleapis/google-cloud-node#1916
Can now include the property __excludeFromIndexes
in your schema definition to target properties that should be excluded from your Datastore indexes, like so:
(Typescript)
const schemaDefinition: SchemaDefinition<IDSWorkerTest> = {
__excludeFromIndexes: [
"testEmbeddedObject",
"testEmbeddedObject.otherStringThing",
"testEmbeddedObject.stringThing",
"testLongString"
],
testID: {
type: "string",
role: "id",
},
testAmount: {
type: "double",
},
testTags: {
type: "array",
required: true,
},
testLongString: {
type: "string",
required: true,
},
testEmbeddedObject: {
type: "object",
required: true,
},
testDate: {
type: "datetime",
required: true,
},
};
Old syntax of excludeFromIndexes
flag on each property still works but is not recommended now as it doesn't allow you to target deep properties easily.
v0.3.9
Added methods for creating keys using the base Pebblebed
object:
Pebblebed.keys()
Pebblebed.keysFromObjectArray()
Pebblebed.uniqueKeysFromObjectArray()
As well as now being able to use those created keys to load entities:
TestModel.load(keys).run()