The Collection type represents a collection in a Database.
Collection
When using TypeScript, collections can be cast to DocumentCollection or EdgeCollection in order to increase type safety.
interface Person { name: string; } interface Friend { startDate: number; endDate?: number; } const db = new Database(); const documents = db.collection("persons") as DocumentCollection<Person>; const edges = db.collection("friends") as EdgeCollection<Friend>;
Type to use for document data. Defaults to any.
any
Generated using TypeDoc
The
Collection
type represents a collection in a Database.When using TypeScript, collections can be cast to DocumentCollection or EdgeCollection in order to increase type safety.
interface Person { name: string; } interface Friend { startDate: number; endDate?: number; } const db = new Database(); const documents = db.collection("persons") as DocumentCollection<Person>; const edges = db.collection("friends") as EdgeCollection<Friend>;