Drop all registered hooks (for testing).
Connect to MongoDB.
MongoDB connection URI (from env var MONGODB_URI)
Database name (default: 'saxonberg')
Delete a document by MongoDB _id.
Dispatches through any registered around-delete hooks for this
collection. The terminal next performs the MongoDB delete.
Collection name
MongoDB _id (string or ObjectId)
Disconnect from MongoDB.
Find documents matching a query.
Collection name
MongoDB query object
Array of matching documents
Find a document by MongoDB _id.
Collection name
MongoDB _id (string or ObjectId)
Document or null if not found
Get a MongoDB collection.
Name of the collection
MongoDB Collection instance
Get the database instance (for advanced operations).
Check if connected to MongoDB.
Load and register hooks from a manifest YAML file.
Each entry clones the named template via StuffApi.clone(), narrows
with MixinApi.isAroundSaveHook / isAroundDeleteHook, and registers
the resulting hook against the named (collection, operation) slot.
Fails loudly on missing template, malformed YAML, or a template whose cloned object doesn't compose the required hook capability.
OptionalyamlPath: stringOptional override; defaults to
<src>/mud/obj/hooks/hooks.yaml.
Register an around-save or around-delete hook against a
(collection, operation) slot.
Multiple hooks may register against the same slot — they execute in
registration order, each receiving next to invoke the rest of the
chain (terminating in the actual MongoDB write).
Today this is privileged only by convention (CODEOWNERS on the manifest file). When the call security framework lands it becomes formally privileged.
Register an around-save or around-delete hook against a
(collection, operation) slot.
Multiple hooks may register against the same slot — they execute in
registration order, each receiving next to invoke the rest of the
chain (terminating in the actual MongoDB write).
Today this is privileged only by convention (CODEOWNERS on the manifest file). When the call security framework lands it becomes formally privileged.
Save a document (insert or update). If document has _id, updates it; otherwise inserts new document.
Dispatches through any registered around-save hooks for this
collection. Hooks may transform the doc, short-circuit, or wrap the
operation. The terminal next performs the MongoDB upsert.
Collection name
Document to save
MongoDB _id (as string)
StaticgetGet the singleton instance.
PersistenceManager - Singleton for MongoDB operations.