Install
$ agentstack add skill-burakdmir-abp-skills-abp-mongodb ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo 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.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
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 →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
- Use
AbpMongoDbContext - Define collection names with
[MongoCollection] - Define indexes in
CreateModel - Set up a replica set for transactions
- 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.
- Author: burakdmir
- Source: burakdmir/abp-skills
- License: MIT
- Homepage: https://abp.io/docs/latest
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.