MCPcopy
hub / github.com/directus/directus / readMany

Method readMany

api/src/services/collections.ts:425–447  ·  view source on GitHub ↗

* Read many collections by name

(collectionKeys: string[])

Source from the content-addressed store, hash-verified

423 * Read many collections by name
424 */
425 async readMany(collectionKeys: string[]): Promise<Collection[]> {
426 if (this.accountability) {
427 await Promise.all(
428 collectionKeys.map((collection) =>
429 validateAccess(
430 {
431 accountability: this.accountability!,
432 action: 'read',
433 collection,
434 skipCollectionExistsCheck: true,
435 },
436 {
437 schema: this.schema,
438 knex: this.knex,
439 },
440 ),
441 ),
442 );
443 }
444
445 const collections = await this.readByQuery();
446 return collections.filter(({ collection }) => collectionKeys.includes(collection));
447 }
448
449 /**
450 * Update a single collection by name

Callers 3

handlerFunction · 0.95
readOneMethod · 0.95
getCollectionPayloadFunction · 0.95

Calls 2

readByQueryMethod · 0.95
validateAccessFunction · 0.85

Tested by

no test coverage detected