• Stars
    star
    228
  • Rank 175,267 (Top 4 %)
  • Language
    JavaScript
  • Created about 12 years ago
  • Updated over 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple REST gui for MongoDB

Mongo Edit

IMPORTANT: this software is not maintained anymore, please don't submit anymore pull requests except for bugfixes

Dead simple Graphical User Interface for MongoDB. This is NOT a complete admin UI, just a way to edit documents manually with a user-friendly interface, as well as create and delete documents and collections It's a perfect fit for people working with an ODM (for example Mongoose) which is in charge of the administration.

We use it in production at tldr.io

What does it do?

It allows you to create, edit and delete documents, as well as create and delete collections. Here are the URLs used in the GUI, to which you can link within your application to directly perform the corresponding operations:

  • / shows the list of all collections
  • /:collection shows the contents of collection (in reverse chronological order, earliest on top)
  • /:collection/new creates a new collection with name :collection
  • /:collection/newDocument creates a new document in collection :collection. All indexed/unique fields are pre-populated with a random string so that it can be saved right away
  • /:collection/:id/edit shows a web-based editor (Ace) so that you can change the contents of the collection's document with id id. The document is shown as a Javascript object that will replace the current one in the database when you save it. The editor features syntax highlighting and checking. An image being worth a thousands words, here is a screenshot:

mongo edit screenshot

  • /:collection/delete: delete :collection. Beware, it won't ask for confirmation if the URL is called directly. It will only ask if you click the "Delete collection" button when on page /:collection.
  • /:collection/:id/delete: delete document with _id :id in :collection. As for the above route, the GUI will ask for confirmation if you click the "Delete" button in the "edit a document" view but not if you call the URL directly.

Install, configure and run

Prerequisite: Node.js should be installed

Preferred method: clone the repo and use an external config file

1) Install with a simple git clone [email protected]:tldrio/mongo-edit.git and then npm install in the created directory.
2) Create a config file in the config directory (there is a sampleConfig.js that explains the parameters and shows an example).
3) Run with node server.js config/yourConfigFile.js
4) Whenever you want to update Mongo Edit, a simple git pull will do the trick. The config directory is gitignored (except the example file) so your config will be preserved

Alternatively, you can use npm

1) Install Mongo Edit in one command: npm install mongo-edit
2) Modify one of the default configurations in the file lib/config.js (which also explains all parameters)
3) Run with NODE_ENV=yourEnv node server.js to run with default config yourEnv or simply node server.js to run with the default environment (called 'development')

You can't update easily with this method though, you would need to npm install Mongo Edit somewhere else and copy paste your modified lib/config.js to restore your config

Config parameters

Everything is explain in lib/config.js, here is a summary:

  • db.host, db.port, db.name: what database to connect to. It is assumed that you run in a trusted environment and don't need password to access the database (this should be the case for all developpement machines and most production machines with a restrictive firewall).
  • db.username and db.password: these are optional. If they are set, Mongo Edit will authentify itself as the given user and throw an error if the credentials are invalid.
  • svPort: the port on which the webserver will run.
  • trustProxy: needs to be set to true if Mongo Edit is run behind a reverse proxy such as Nginx. If you run Mongo Edit in production and it is accessible from the outside, this should be the case. Obviously, it should be protected by a BasicAuth over SSL.
  • pagination: the parameters for the pagination when showing the contents of a collection. The defaults should be fine.

Running Mongo Edit in production

If you run Mongo Edit in production, be aware that it doesn't provide you with any security and will accept connections from anyone. Make sure to run it behind your reverse proxy, and protected with a Basic Auth over SSL.

Feature requests and bugfixes

We want Mongo Edit to remain super simple, there are already plenty complete admin UIs out there. Still, if you think something is missing don't hesitate to drop us an issue or a PR. And of course please do so if you find a bug :)

Contributors

project: mongo-edit
commits: 135
active : 23 days
files  : 121
authors: 
129  Louis Chatriot          95.6%
  4  Raymond Feng            3.0%
  1  HeroicYang              0.7%
  1  Stanislas Marion        0.7%

License

(The MIT License)

Copyright (c) 2012 tldr.io <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

nedb

The JavaScript Database, for Node.js, nw.js, electron and the browser
JavaScript
13,357
star
2

node-redis-pubsub

Simple pubsub for node using Redis
JavaScript
280
star
3

node-binary-search-tree

Self-balancing binary search tree for Node.js (uses AVL tree)
JavaScript
146
star
4

nedb-to-mongodb

Utility to transfer all your data in a nedb database in a MongoDB collection
JavaScript
85
star
5

nedb-logger

A logger that output message to a file in an nedb-readable format with minimal memory footprint
JavaScript
50
star
6

braindead-ci

JavaScript
48
star
7

connect-nedb-session

NeDB-backed session store for the Connect/Express session middleware
JavaScript
37
star
8

express-group-handlers

Apply a middleware only to a group of route handlers in Express
JavaScript
32
star
9

h4e

Hogan for Express, with support for partials
JavaScript
18
star
10

trello-capture

Chrome extension to take a (partial) screenshot of a webpage and create a new Trello card with it in it
JavaScript
15
star
11

nedb-server

HTTP interface for a NeDB database
JavaScript
12
star
12

M-command

Chrome plugin to get the same behaviour as vim's M command
JavaScript
12
star
13

exec-time

See how much time every step of a node script takes
JavaScript
10
star
14

express-nedb-session

Nedb-backed session store for Express 4 session middleware
JavaScript
9
star
15

taffydb-benchmark

Benchmark of TaffyDB on basic CRUD operations. The benchmark code is the same as the one used for NeDB.
JavaScript
7
star
16

url-shortener

A basic url shortener
JavaScript
5
star
17

raspi-media-center

Media center based on Rasberry Pi, remotely controllable by smartphone through HTTP server
JavaScript
5
star
18

node-pbkdf2

Wrapper to hash and check password with crypto's built-in pbkdf2, abstracting the API change between node v0.8 and v0.10
JavaScript
5
star
19

NodejsStarterKit

Starter kit I use on my side projects to create websites/api with nodejs and express
JavaScript
4
star
20

raycasting

Minimal raycasting 3D engine
JavaScript
3
star
21

Stanford-Classes

My project files for Stanford's online classes
Java
3
star
22

lm-heatmap

Local Motion heatmaps
JavaScript
3
star
23

dotfiles

My dotfiles
Shell
3
star
24

tetris

A small DOM tetris game
JavaScript
2
star
25

data-graphs

Small chart library for use with Local Motion's data reports
JavaScript
2
star
26

peaceful-internet

Remove unneeded attention grabbing from the internet
JavaScript
2
star
27

btc-bot

JavaScript
2
star
28

pipedrive-plus

Set of tools to enhance Pipedrive
JavaScript
2
star
29

snake

A good old snake
JavaScript
1
star
30

jeu-ines

Q&A game for my sister's marriage
JavaScript
1
star
31

raytracing

A minimalist raytracing engine
Python
1
star
32

fundor

Self-updating list of startup that raise money
JavaScript
1
star
33

ml_example

Super basic example to show how machine learning works
JavaScript
1
star
34

mariokart-web-client

JavaScript
1
star
35

advent-of-code

Hopefully I have the time to do it!
Python
1
star
36

gop

Multiplayer real time Go playing server
JavaScript
1
star