directus-monorepo ( Readme | API )
directus-monorepo > CollectionsService
new CollectionsService(
options):CollectionsService
| Parameter | Type |
|---|---|
options |
AbstractServiceOptions |
api/src/services/collections.ts:45
accountability:
any
api/src/services/collections.ts:39
cache:
null|Keyv<any,Record<string,unknown> >
api/src/services/collections.ts:42
helpers:
object
date:
DateHelperMySQL|DateHelperDefault|DateHelperSQLite|DateHelperOracle|DateHelperMSSQLschema:
SchemaHelperMySQL|SchemaHelperDefault|SchemaHelperCockroachDb|SchemaHelperSQLite|SchemaHelperOracle|SchemaHelperMSSQLsequence:
AutoIncrementHelperDefault|AutoIncrementHelperPostgresst:
GeometryHelperMySQL|GeometryHelperPostgres|GeometryHelperSQLite|GeometryHelperOracle|GeometryHelperMSSQL|GeometryHelperRedshift
api/src/services/collections.ts:38
knex:
Knex<any,any[] >
api/src/services/collections.ts:37
schema:
SchemaOverview
api/src/services/collections.ts:41
schemaInspector:
SchemaInspector
api/src/services/collections.ts:40
systemCache:
Keyv<any,Record<string,unknown> >
api/src/services/collections.ts:43
createMany(
payloads,opts?):Promise<string[] >
Create multiple new collections
| Parameter | Type |
|---|---|
payloads |
RawCollection[] |
opts? |
MutationOptions |
Promise< string[] >
api/src/services/collections.ts:224
createOne(
payload,opts?):Promise<string>
Create a single new collection
| Parameter | Type |
|---|---|
payload |
RawCollection |
opts? |
MutationOptions |
Promise< string >
api/src/services/collections.ts:60
deleteMany(
collectionKeys,opts?):Promise<string[] >
Delete multiple collections by key
| Parameter | Type |
|---|---|
collectionKeys |
string[] |
opts? |
MutationOptions |
Promise< string[] >
api/src/services/collections.ts:702
deleteOne(
collectionKey,opts?):Promise<string>
Delete a single collection This will delete the table and all records within. It'll also delete any fields, presets, activity, revisions, and permissions relating to this collection
| Parameter | Type |
|---|---|
collectionKey |
string |
opts? |
MutationOptions |
Promise< string >
api/src/services/collections.ts:567
readByQuery():
Promise<Collection[] >
Read all collections. Currently doesn't support any query.
Promise< Collection[] >
api/src/services/collections.ts:274
readMany(
collectionKeys):Promise<Collection[] >
Read many collections by name
| Parameter | Type |
|---|---|
collectionKeys |
string[] |
Promise< Collection[] >
api/src/services/collections.ts:366
readOne(
collectionKey):Promise<Collection>
Get a single collection by name
| Parameter | Type |
|---|---|
collectionKey |
string |
Promise< Collection >
api/src/services/collections.ts:355
updateBatch(
data,opts?):Promise<string[] >
Update multiple collections in a single transaction
| Parameter | Type |
|---|---|
data |
Partial< Collection >[] |
opts? |
MutationOptions |
Promise< string[] >
api/src/services/collections.ts:457
updateMany(
collectionKeys,data,opts?):Promise<string[] >
Update multiple collections by name
| Parameter | Type |
|---|---|
collectionKeys |
string[] |
data |
Partial< Collection > |
opts? |
MutationOptions |
Promise< string[] >
api/src/services/collections.ts:518
updateOne(
collectionKey,data,opts?):Promise<string>
Update a single collection by name
| Parameter | Type |
|---|---|
collectionKey |
string |
data |
Partial< Collection > |
opts? |
MutationOptions |
Promise< string >
api/src/services/collections.ts:390
Generated using TypeDoc and typedoc-plugin-markdown