MongoDB Driver for Emacs and minor mode support.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
Makefile
README.md
examples-after.txt
examples.txt
helper.c
helper.h
mongo.el
patch.diff

README.md

EMongo -- A Mongo Driver for Emacs

An elisp driver for Mongo, and Emacs minor mode for working with json documents, commands, and queries. It is built using a patched version of Emacs that dynamically links with the mongo c driver. Additionally it can take queries or documents from a buffer, and insert results back into the buffer.

Examples

See examples.txt for a walk through example, and examples-after.txt for what it looks like after running the example.

Warnings

This code is completely unsupported. Use at your own risk.

Depedencies:

  1. Emacs
  2. Mongo C Driver

See below for full installation instructions.

Installation

Below targets running on OS X with homebrew:

Build the Mongo C Driver

brew install pkgconfig cmake
mkdir mongoc
pushd mongoc
    curl -LO https://github.com/mongodb/mongo-c-driver/releases/download/1.11.0/mongo-c-driver-1.11.0.tar.gz
    tar xzf mongo-c-driver-1.11.0.tar.gz
    cd mongo-c-driver-1.11.0
    mkdir cmake-build
    cd cmake-build
    cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..
    make -j 4
    sudo make install
popd

Build Emacs itself

The file patch.diff is in this repo.

git clone -b emacs-26.1 git://git.sv.gnu.org/emacs.git
patch -p1 < patch.diff
cd emacs
./autogen.sh
./configure --without-makeinfo
make -j 4

Binary is in src/emacs.

Add to your ~/.emacs:

(add-to-list 'load-path (concat (getenv "MONGO_MODE_HOME") "/mongo-mode"))
(require 'mongo)