AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Abp Mongodb

skill-burakdmir-abp-skills-abp-mongodb · by burakdmir

ABP Framework v10.4 MongoDB: AbpMongoDbContext, collection mapping, index, transaction, replica set, repository. Use when working with MongoDB, document databases, or MongoDB repositories in ABP.

No reviews yet
0 installs
28 views
0.0% view→install

Install

$ agentstack add skill-burakdmir-abp-skills-abp-mongodb

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-burakdmir-abp-skills-abp-mongodb)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Abp Mongodb? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

ABP Framework — MongoDB

ABP Framework v10.4 MongoDB integration. MongoDbContext, collection mapping, repository, indexes, transactions.

Trigger

  • "ABP MongoDB"
  • "ABP MongoDbContext"
  • "ABP Mongo repository"
  • "ABP Mongo collection"
  • "ABP Mongo index"
  • "ABP Mongo transaction"

Installation

abp add-package Volo.Abp.MongoDB
[DependsOn(typeof(AbpMongoDbModule))]
public class MyModule : AbpModule { }

MongoDbContext

public class MyDbContext : AbpMongoDbContext
{
    public IMongoCollection Questions => Collection();
    public IMongoCollection Categories => Collection();

    protected override void CreateModel(IMongoModelBuilder modelBuilder)
    {
        base.CreateModel(modelBuilder);
        modelBuilder.Entity(b => { b.CollectionName = "MyQuestions"; b.BsonMap.UnmapProperty(x => x.MyProperty); });
    }
}

Or via attribute: [MongoCollection("MyQuestions")]

Index

modelBuilder.Entity(b =>
{
    b.CreateCollectionOptions.Collation = new Collation(locale: "en_US", strength: CollationStrength.Secondary);
    b.ConfigureIndexes(indexes => indexes.CreateOne(new CreateIndexModel(Builders.IndexKeys.Ascending("MyProperty"), new CreateIndexOptions { Unique = true })));
});

DbContext Registration

context.Services.AddMongoDbContext(options => options.AddDefaultRepositories());

Custom Repository

public interface IBookRepository : IRepository { Task DeleteBooksByTypeAsync(BookType type); }

public class BookRepository : MongoDbRepository, IBookRepository
{
    public BookRepository(IMongoDbContextProvider dbContextProvider) : base(dbContextProvider) { }
    public async Task DeleteBooksByTypeAsync(BookType type)
    {
        var collection = await GetCollectionAsync();
        await collection.DeleteManyAsync(Builders.Filter.Eq(b => b.Type, type));
    }
}

MongoDB API Access

IMongoDatabase db = await _repository.GetDatabaseAsync();
IMongoCollection coll = await _repository.GetCollectionAsync();
IAggregateFluent agg = await _repository.GetAggregateAsync();

Transactions

MongoDB 4.0+ supports transactions. In the startup templates they are disabled by default.

Enable: In YourProjectMongoDbModule, remove the AddAlwaysDisableUnitOfWorkTransaction() and TransactionBehavior = Disabled code.

Docker Replica Set:

services:
  mongo:
    image: mongo:8.0
    command: ["--replSet", "rs0", "--bind_ip_all", "--port", "27017"]
    ports: [27017:27017]

Connection: mongodb://localhost:27017/YourProjectName?replicaSet=rs0

EF Core vs MongoDB

| Feature | EF Core | MongoDB | |---|---|---| | DbContext | AbpDbContext | AbpMongoDbContext | | Query | IQueryable (LINQ) | Filter/Aggregate | | Transaction | Enabled by default | Disabled by default | | Change Tracking | Yes | No | | Extra Properties | JSON field | Native element |

Best Practices

  1. Use AbpMongoDbContext
  2. Define collection names with [MongoCollection]
  3. Define indexes in CreateModel
  4. Set up a replica set for transactions
  5. Define custom repositories in the MongoDB layer

Related

[DDD](../abp-ddd/SKILL.md) · [EF Core](../abp-efcore/SKILL.md) · [Dependency Rules](../abp-dependency-rules/SKILL.md) · [Multi-Tenancy](../abp-multitenancy/SKILL.md) · Docs: https://abp.io/docs/latest/framework/data/mongodb

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.