UNPKG

mongodb-rag-ingest

Version:

MongoDB Ingest CLI for the MongoDB Chatbot Framework.

32 lines 1.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const mongodb_memory_server_1 = require("mongodb-memory-server"); const constants_1 = require("./constants"); async function default_1() { try { const mongoMemoryServerInstance = await mongodb_memory_server_1.MongoMemoryServer.create({ instance: { port: constants_1.SERVER_PORT, ip: constants_1.IP, }, }); global.__MONGO_MEMORY_SERVER_INSTANCE = mongoMemoryServerInstance; const mongoMemoryServerReplicaSet = await mongodb_memory_server_1.MongoMemoryReplSet.create({ instanceOpts: [ { port: constants_1.REPLICA_SET_PORT, }, ], replSet: { ip: constants_1.IP, }, }); global.__MONGO_MEMORY_REPLICA_SET = mongoMemoryServerReplicaSet; } catch (error) { console.error("Error in global setup:", error); throw error; } } exports.default = default_1; //# sourceMappingURL=globalSetup.js.map