
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
@alterior/mongo
Advanced tools
Use this package if you want to connect to MongoDB from your Alterior application.
npm i mongodb @alterior/mongo
Now use mongoProvider to inject an instance of mongodb.Db into your application:
import { AppOptions } from '@alterior/core';
import { mongoProvider } from '@alterior/mongo';
import * as mongodb from 'mongodb';
@AppOptions({
providers: [mongoProvider(mongodb.Db)]
})
class App {
}
Now, you can inject mongodb.Db into your controllers:
import { Controller, Get } from '@alterior/core';
import * as mongodb from 'mongodb';
@Controller()
class SampleController {
constructor(
private db : mongodb.Db
) {
}
@Get('/stuff')
public getStuff() {
return this.db.collection('stuff').find().toArray();
}
}
You can pass any token into mongoProvider, which can be used to inject multiple database connections if necessary.
This package also provides a connector for storing Express sessions in MongoDB using mongo-connect.
import * as mongodb from 'mongodb';
import { mongoProvider, mongoSession } from '@alterior/mongo';
@AppOptions({
providers: [mongoProvider(mongodb.Db)]
middleware: [mongoSession(mongodb.Db, SESSION_SECRET)]
})
export class App { }
You can then access and modify session data from your route methods. We recommend you make an interface representing your session data.
interface SessionData {
displayName : string;
cartTotal : number;
}
@Controller()
class SampleController {
@Get('/cart/total')
public get(session : SessionData) {
return session.cartTotal;
}
}
FAQs
MongoDB connector for Alterior applications
The npm package @alterior/mongo receives a total of 9 weekly downloads. As such, @alterior/mongo popularity was classified as not popular.
We found that @alterior/mongo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.