Mongo Proxy

Maven Central Build Status Coverage Status

A proxy for MongoDB written in Java. Using this proxy allows to easily trigger additional actions when data is inserted in the database

Developement now takes place at


// port on which the proxy will be listening 
int PORT = 9632;
ProxyServer srv = new ProxyServer(PORT);
srv.addListener("admin.$cmd", new Listener() {
    public void run(Document doc) {
        System.out.println("Notified: " + doc);

MongoDb Wire Protocol Structure

this table shows the structure of the driver message for different version of driver and command done.

Version of mongodb driver Command Mongodb Wire protocol
3.5 db/collection/insertOne(document) opCode = Op_Query
. . fullCollectionName = dbName.$cmd
. . Document = [insert:collectionName, ordered:true, documents:[...] ]

Check this project on GitLab

This website uses cookies. More information about the use of cookies is available in the cookies policy.