@cognitiveproof/softbinding-api-plugin-mongodb
v1.0.2
Published
MongoDB data store plugin for the C2PA Soft Binding Resolution API server
Readme
@cognitiveproof/softbinding-api-plugin-mongodb
MongoDB DataStorePlugin for @cognitiveproof/softbinding-api-server — the C2PA Soft Binding Resolution API server.
Persists C2PA Manifest Stores, soft binding associations, and repository receipts in MongoDB.
Install
npm install @cognitiveproof/softbinding-api-server @cognitiveproof/softbinding-api-plugin-mongodbUsage
import { createServer } from '@cognitiveproof/softbinding-api-server';
const app = createServer({
dataStore: '@cognitiveproof/softbinding-api-plugin-mongodb',
// ...
});Or pass the package name via the DATASTORE_PLUGIN environment variable and omit the dataStore option entirely.
Configuration
| Env var | Required | Description |
| -------------- | -------- | ---------------------------------------------------------------- |
| MONGO_DB_URI | Yes | MongoDB connection string, e.g. mongodb://localhost:27017/c2pa |
Collections
The plugin uses two collections, created automatically on first use:
manifests—{ id, data, contentType, receipt }bindings—{ id (binding value), manifestIds[] }, with a one-to-many relationship to manifests viamanifestIds
