Skip to content

ema / @internals/db / MongoActorDB

Class: MongoActorDB

Defined in: db/mongo.actor.ts:9

MongoDB-based implementation of ActorDB Stores actor data in a MongoDB collection

Implements

Constructors

Constructor

ts
new MongoActorDB(mongo): MongoActorDB;

Defined in: db/mongo.actor.ts:22

Creates a new MongoActorDB instance

Parameters

mongo

Mongo

MongoDB instance to use for database operations

Returns

MongoActorDB

Properties

collections

ts
collections: string[];

Defined in: db/mongo.actor.ts:16

The collection names being accessed

Methods

deleteActor()

ts
deleteActor(id): Promise<boolean>;

Defined in: db/mongo.actor.ts:70

Deletes an actor from the database

Parameters

id

number

The unique identifier for the actor to delete

Returns

Promise<boolean>

Promise resolving to true if deleted, false if not found

Implementation of

ActorDB.deleteActor


getActor()

ts
getActor(id): Promise<ActorEntity | null>;

Defined in: db/mongo.actor.ts:42

Gets a specific actor by ID

Parameters

id

number

The unique identifier for the actor

Returns

Promise<ActorEntity | null>

Promise resolving to the actor data or null if not found

Implementation of

ActorDB.getActor


listActors()

ts
listActors(): Promise<ActorEntity[]>;

Defined in: db/mongo.actor.ts:30

Lists all actors in the database

Returns

Promise<ActorEntity[]>

Promise resolving to an array of actor data

Implementation of

ActorDB.listActors


upsertActor()

ts
upsertActor(entity): Promise<number>;

Defined in: db/mongo.actor.ts:60

Inserts or updates an actor in the database

Parameters

entity

ActorEntity

The actor data to upsert

Returns

Promise<number>

Promise resolving to the ID of the created or updated actor

Implementation of

ActorDB.upsertActor