import { toEntity } from "https://deno.land/x/google_datastore@0.0.14/mod.ts";
A symbol which can be used to provide a custom method to generate an
Entity
serialization for an object. When performing
objectToEntity
, this method will be used instead of built in
serialization of objects to entities.
Example
import { toEntity } from "google_datastore.ts";
class A {
a = "value";
id = "a";
[toEntity]() {
return {
key: { path: [ { id: this.id, kind: A.KIND } ] },
properties: { a: { stringValue: this.a }},
}
}
static KIND = "A";
}