ILibraryStorage
interface that stores the metadata of libraries in MongoDB and the files in S3. You can find the storage class in /packages/h5p-mongos3/src/MongoS3LibraryStorage.ts.npm install aws-sdk mongodb
!createIndexes()
every time you start you application, as MongoDB checks if indexes already exist before it creates new ones.initMongo
through the function parameters. Alternatively you can use these environment variables instead of using the function parameters:h5p
to any name you want. If the collection doesn't exist yet, it will be automatically created.h5plibrarybucket
to any name you want, but you must specify one. You must create the bucket manually before you can use it.initS3
is passed on to aws-sdk
, so you can set any custom configuration values you want.initS3
or initMongo
and instantiate the required clients yourself.maxKeyLength
to the value you need. It defaults to 1024./test/implementation/db/MongoS3LibraryStorage.test.ts
. However, these tests will not be called automatically when you run npm run test
or other test calls. The reason is that the tests require a running MongoDB and S3 instance and thus need more extensive setup. To manually execute the tests call npm run test:db
.