UNPKG

@goatlab/typesense

Version:

Modern TypeScript wrapper for Typesense search engine API

18 lines 674 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createCollection = createCollection; async function createCollection(ctx, collection) { // Use fqcn for the collection name if tenant is configured const collectionWithFqcn = { ...collection, name: ctx.fqcn(collection.name) }; const result = await ctx.httpClient.request('/collections', { method: 'POST', body: collectionWithFqcn }); // Cache the schema with the fully qualified name ctx.schemaManager.setCachedSchema(collectionWithFqcn.name, collectionWithFqcn); return result; } //# sourceMappingURL=createCollection.js.map