Code Monkey home page Code Monkey logo

mongo-express's Introduction

mongo-express

npm version npm GitHub stars Known Vulnerabilities Build Status

A web-based MongoDB admin interface written with Node.js, Express, and Bootstrap 5

Features

  • Connect to multiple databases
  • View/add/delete databases
  • View/add/rename/delete collections
  • View/add/update/delete documents
  • Preview audio/video/image assets inline in the collection view
  • Nested and/or large objects are collapsible for easy overview
  • Async on-demand loading of big document properties (>100KB default) to keep collection view fast
  • GridFS support - add/get/delete incredibly large files
  • Use BSON data types in documents
  • Mobile / Responsive - Bootstrap 5 works passably on small screens when you're in a bind
  • Connect and authenticate to individual databases
  • Authenticate as admin to view all databases
  • Database blacklist/whitelist
  • Custom CA/TLS/SSL and CA validation disabling
  • Supports replica sets

Screenshots

Home Page Database View Collection View Editing A Document

These screenshots are from version 0.30.40 View the album for more screenshots: (server status, database views, etc..) https://imgur.com/a/9vHsF

Development

To test or develop with the latest version you can install using this git repository:

npm i mongo-express@git+https://github.com/mongo-express/mongo-express.git#master

Copy config.default.js to config.js and edit the default property to fit your local environment

Run the development build using:

npm run start-dev

Usage (npm / CLI)

mongo-express requires Node.js v4 or higher.

To install:

npm install -g mongo-express

Or if you want to install a non-global copy:

npm install mongo-express

By default config.default.js is used where the basic access authentication is admin:pass. This is obviously not safe, and there are warnings in the console.

To configure:

Copy YOUR_PATH/node_modules/mongo-express/config.default.js into a new file called YOUR_PATH/node_modules/mongo-express/config.js.

Note: YOUR_PATH will depend on your current OS user and system configuration. You can see it in the output text shown after executing npm install.

Fill in your MongoDB connection details and any other options you want to change in config.js.

You will also need to create a .env file with the variables for your cookie and session secrets, these are just default values

ME_CONFIG_SITE_COOKIESECRET: 'cookiesecret',
ME_CONFIG_SITE_SESSIONSECRET: 'sessionsecret',

To run:

cd YOUR_PATH/node_modules/mongo-express/ && node app.js

or if you installed it globally, you can immediately start mongo-express like this:

mongo-express

You can add some configuration options. Example:

node app.js --url mongodb://127.0.0.1:27017

or:

mongo-express --URL mongodb://127.0.0.1:27017

Configuration options:

Option Short Description
--version -V output the version number
--url <url> -U <url> connection string url (<url> example: mongodb://127.0.0.1:27017)
--admin -a enable authentication as admin
--port <port> -p <port> listen on specified port (default <port> is 8081)
--help -h display help for command options

Usage (Express 4 middleware)

To mount as Express 4 middleware (see node_modules/mongo-express/app.js):

var mongo_express = require('mongo-express/lib/middleware')
var mongo_express_config = require('./mongo_express_config')

app.use('/mongo_express', mongo_express(mongo_express_config))

Usage (Docker)

Make sure you have a running MongoDB container on a Docker network (--network some-network below) with --name or --network-alias set to mongo. Alternatively, set the connection string ME_CONFIG_MONGODB_URL to the proper connection for your MongoDB container on your Docker network.

Use the Docker Hub image:

$ docker run -it --rm -p 8081:8081 --network some-network mongo-express

Build from source:

Build an image from the project directory, then run the image.

$ docker build -t mongo-express .
$ docker run -it --rm -p 8081:8081 --network some-network mongo-express

You can use the following environment variables to modify the container's configuration:

Name Default Description
ME_CONFIG_MONGODB_URL mongodb://admin:pass@localhost:27017/db?ssl=false
ME_CONFIG_MONGODB_ENABLE_ADMIN false Enable administrator access. Send strings: "true" or "false".
ME_CONFIG_MONGODB_AUTH_USERNAME admin Database username (only needed if ENABLE_ADMIN is "false").
ME_CONFIG_MONGODB_AUTH_PASSWORD pass Database password (only needed if ENABLE_ADMIN is "false").
ME_CONFIG_MONGODB_ALLOW_DISK_USE false Remove the limit of 100 MB of RAM on each aggregation pipeline stage.
ME_CONFIG_MONGODB_TLS false Use TLS client certificate
ME_CONFIG_MONGODB_TLS_ALLOW_CERTS true Validate mongod server certificate against CA
ME_CONFIG_MONGODB_TLS_CA_FILE `` CA certificate File
ME_CONFIG_MONGODB_TLS_CERT_FILE `` TLS client certificate file
ME_CONFIG_MONGODB_TLS_CERT_KEY_FILE `` TLS client certificate key file
ME_CONFIG_MONGODB_TLS_CERT_KEY_FILE_PASSWORD `` TLS client certificate key file password
ME_CONFIG_MONGODB_URL_FILE `` File version of ME_CONFIG_MONGODB_URL
ME_CONFIG_SITE_BASEURL / Set the express baseUrl to ease mounting at a subdirectory. Remember to include leading and trailing slash.
ME_CONFIG_HEALTH_CHECK_PATH /status Set the mongo express healthcheck path. Remember to add the forward slash at the start.
ME_CONFIG_SITE_COOKIESECRET cookiesecret String used by cookie-parser middleware to sign cookies.
ME_CONFIG_SITE_SESSIONSECRET sessionsecret String used to sign the session ID cookie by express-session middleware.
ME_CONFIG_BASICAUTH false Enable Basic Authentication. Send strings: "true" or "false".
ME_CONFIG_BASICAUTH_USERNAME `` mongo-express web login name. Sending an empty string will disable basic authentication.
ME_CONFIG_BASICAUTH_PASSWORD `` mongo-express web login password.
ME_CONFIG_REQUEST_SIZE 100kb Used to configure maximum Mongo update payload size. CRUD operations above this size will fail due to restrictions in body-parser.
ME_CONFIG_OPTIONS_READONLY false if readOnly is true, components of writing are not visible.
ME_CONFIG_OPTIONS_FULLWIDTH_LAYOUT false If set to true an alternative page layout is used utilizing full window width.
ME_CONFIG_OPTIONS_PERSIST_EDIT_MODE false If set to true, remain on the same page after clicking on the Save button
ME_CONFIG_OPTIONS_NO_DELETE false If noDelete is true, components of deleting are not visible.
ME_CONFIG_SITE_SSL_ENABLED false Enable SSL.
ME_CONFIG_SITE_SSL_CRT_PATH SSL certificate file.
ME_CONFIG_SITE_SSL_KEY_PATH SSL key file.
ME_CONFIG_SITE_GRIDFS_ENABLED false Enable gridFS to manage uploaded files.
ME_CONFIG_BASICAUTH_USERNAME_FILE `` File version of ME_CONFIG_BASICAUTH_USERNAME
ME_CONFIG_BASICAUTH_PASSWORD_FILE `` File version of ME_CONFIG_BASICAUTH_PASSWORD
ME_CONFIG_DOCUMENTS_PER_PAGE 10 How many documents you want to see at once in collection view
PORT 8081 port that mongo-express will run on.
VCAP_APP_HOST localhost address that mongo-express will listen on for incoming connections.

Example:

docker run -it --rm \
    --name mongo-express \
    --network web_default \
    -p 8081:8081 \
    -e ME_CONFIG_BASICAUTH_USERNAME="" \
    -e ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \
    mongo-express

This example links to a container name typical of docker-compose, changes the editor's color theme, and disables basic authentication.

To use:

The default port exposed from the container is 8081, so visit http://localhost:8081 or whatever URL/port you entered into your config (if running standalone) or whatever config.site.baseUrl (if mounting as a middleware).

Using Docker Extensions:

Pre-requisite:

  • Docker Desktop 4.15

Usage:

By using Mongo Express Docker Extension, it's easy to setup Mongo Express on Docker Desktop with just one click.

Usage (IBM Cloud)

Deploy to IBM Cloud

Doing manually:

  • Git clone this repository
  • Create a new or use already created MongoDB service
  • Change the file manifest.yml to fit your IBM Cloud app and service environment

Doing automatically:

  • Click the button below to fork into IBM DevOps Services and deploy your own copy of this application on IBM Cloud

Deploy to IBM Cloud

Then, take the following action to customize to your environment:

  • Create your config.js file based on config.default.js
    • Check if it is necessary to change the dbLabel according to the MongoDB service created
    • Change the basicAuth properties, do not to keep the default values

Search

  • Simple search takes the user provided fields (key & value) and prepares a MongoDB find() object, with projection set to {} so returns all columns.
  • Advanced search passes the find and projection fields/objects straight into MongoDB db.collection.find(query, projection). The find object is where your query happens, while the projection object determines which columns are returned.

See MongoDB db.collection.find() documentation for examples and exact usage.

Planned features

Pull Requests are always welcome! <3

Limitations

  • Documents must have the document._id property to be edited
  • Binary BSON data type not tested

E2E Testing

We are currently trying to use Cypress, to open cypress use the command `cypress open`
To instrument the code to allow the E2E coverage to run, please run this command: `yarn nyc instrument --compact=false lib instrumented`

Not Tested

  • Binary/BinData

JSON documents are parsed through a javascript virtual machine, so the web interface can be used for executing malicious javascript on a server.

mongo-express should only be used privately for development purposes.

BSON Data Types

The following BSON data types are supported in the mongo-express document editor/viewer.

Native Javascript Types

Strings, numbers, lists, booleans, null, etc.

All numbers in Javascript are 64-bit floating points.

ObjectID/ObjectId

ObjectId()

Creates a new Object ID type.

ObjectId(id)

Use Object ID with the given 24-digit hexadecimal string.

ISODate

ISODate()

Creates a new ISODate object with the current time.

new Date() can also be used (note the new keyword there).

ISODate(timestamp)

Uses ISODate object with the given timestamp.

UUID

UUID()

Creates a new UUID v4.

Can also be used new UUID() (note the new keyword there).

UUID(uuid)

Uses UUID v4 with the given 24-digit hexadecimal string.

Example: UUID("dee11d4e-63c6-4d90-983c-5c9f1e79e96c") or UUID("dee11d4e63c64d90983c5c9f1e79e96c")

DBRef/Dbref

DBRef(collection, objectID)

DBRef(collection, objectID, database)

Object ID is the ID string, not the ObjectId type.

The database value is optional.

Timestamp

Timestamp()

Creates a new Timestamp object with a value of 0.

Timestamp(time, ordinal)

Example: Timestamp(ISODate(), 0).

See http://www.mongodb.org/display/DOCS/Timestamp+data+type for more info about the Timestamp data type.

Code

Code(code)

Code can be a native Javascript function, or it can be a string.

Specifying a scope/context is not supported.

MinKey

MinKey()

MaxKey

MaxKey()

Symbol

Symbol(string)

Example Document

Here is an example of a document which can be read/edited in mongo-express (media truncated for legibility):

{
  "_id": ObjectId(),
  "dates": {
    "date": ISODate("2012-05-14T16:20:09.314Z"),
    "new_date": ISODate(),
    "alternative": new Date()
  },
  "photo": "data:image/jpeg;base64,/9j/4...",
  "video": "data:video/webm;base64,GkXfo...",
  "audio": "data:audio/ogg;base64,T2dnUw...",
  "bool": true,
  "string": "hello world!",
  "list of numbers": [
    123,
    111e+87,
    4.4,
    -12345.765
  ],
  "reference": DBRef("collection", "4fb1299686a989240b000001"),
  "ts": Timestamp(ISODate(), 1),
  "minkey": MinKey(),
  "maxkey": MaxKey(),
  "func": Code(function() { alert('Hello World!') }),
  "symbol": Symbol("test")
}

mongo-express's People

Contributors

andzdroid avatar blackthornyugen avatar damien-malescot avatar dependabot-preview[bot] avatar dependabot[bot] avatar dozoisch avatar eduardomourar avatar greenkeeperio-bot avatar heartnetkung avatar hemanthmalla avatar jafarakhondali avatar jeffreywescott avatar karthik25 avatar knickers avatar mahdiabbasi95 avatar marshallswain avatar mathieumg avatar mikeyburkman avatar morriz avatar muxahuk avatar oocaz avatar petrkrulis avatar rtritto avatar serverwentdown avatar shakaran avatar soomtong avatar spacem avatar tatakci avatar wulfsolter avatar xtudos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mongo-express's Issues

Cant Start Server - 500 TypeError: Object false has no method 'indexOf'

Hi @andzdroid,
I followed the installation instructions to the letter:

$ npm install -g mongo-express
$ cd /usr/local/lib/node_modules/mongo-express
$ cp config.default.js config.js
$ node app

But when I visit: http://46.137.53.149:8081/
I get:

Express
500 TypeError: Object false has no method 'indexOf'

    at Object.parseJSONCookie (/usr/local/lib/node_modules/mongo express/node_modules/express/node_modules/connect/lib/utils.js:222:16)
    at /usr/local/lib/node_modules/mongo-express/node_modules/express/node_modules/connect/lib/utils.js:207:23
    at Array.forEach (native)

Screenshot: http://ideaq.co/Mongo-express-fails-to-start.png

the project screenshots look great so keen to use it.
I just want to check if anyone else has had this issue before I start debugging...
any help would be much appreciated.
Thanks.

Stack info:
OS: Ubuntu 11.10 (EC2)
node: v0.6.16
mongodb: 2.0.6 (installed using apt-get install mongodb)

ISODate format output bug

I stored some crawled data in mongodb and there is a field "created" which value format looks like this in mongo-express:

bug

It looks fine, but when I tend to export it to JSON file, there appears a character error:
export

No option to create new databases

I think I set up mongo wrong or something.
I'm a beginner tho.

When I login into mongo-express, I cannot create databases, even tho I it authenticates against a root-role user.

screenshot

updating a record breaks mongodb query for other open mongodb connections in node server

I have a node server with an open mongodb connection for the life time of the server. Now if I update some record in some collection using mongo-express, my nodejs server's already open mongodb connection fails to query that collection. After that I tried to update other record in same collection using mongo-express, and mongo-express failed to update record and showed me 'That document is not valid!' error.

Hash-signs in document names are not properly url-encoded

I have a collection. In that collection there is a document called "rank#2"

Searching for it works fine:
http://localhost:8081/db/mstore/massiveperms_thing?key=_id&value=%23rank2
Note that the hash-sign is encoded to %23.

When I click it and try to open it does however not work:
http://localhost:8081/db/mstore/massiveperms_thing/#rank2

And if I manually enter
http://localhost:8081/db/mstore/massiveperms_thing/%23rank2
And edit and save I get the error "You forgot to enter a collection name!"

Please ensure that you set the default write concern message

I have got this annoying message everytime I launch app.js.

Please ensure that you set the default write concern for the database by setting 
one of the options
   w: (value of > -1 or the string 'majority'), where < 1 means
      no write acknowledgement
   journal: true/false, wait for flush to journal before acknowledgement
   fsync: true/false, wait for flush to file system before acknowledgement

For backward compatibility safe is still supported and
 allows values of [true | false | {j:true} | {w:n, wtimeout:n} | {fsync:true}] 
the default value is false which means the driver receives does not
 return the information of the success/error of the insert/update/remove
 ex: new Db(new Server('localhost', 27017), {safe:false})
 http://www.mongodb.org/display/DOCS/getLastError+Command

The default of no acknowledgement will change in the very near future
This message will disappear when the default safe is set on the driver Db

I tried to set dbOptions accordingly to the recommendations with no success.

support import data

I can't find a controller to import collection data, already have this feature?

mongoDB version compatibility

I wat to add a document but it says :
"Something went wrong: MongoError: driver is incompatible with this server version"

Recent version not supported yet ?

Admin Database connected but error

Hello, i'm using mongodb with a replicaset and multirouters

I want to use mongo-express to administrate my cluster, so there is my config.js:

module.exports = {
  mongodb: {
    server: 'db-1.xxxxxxxx.fr', // It's 1 router, but there are 3
    port: 27019,
    autoReconnect: true,
    poolSize: 4,
    admin: true,

    adminUsername: 'siteRootAdmin',
    adminPassword: 'xxxxxxxxx',
    whitelist: [],
    blacklist: []
  },
  site: {
    baseUrl: '/',
    port: 3000,
    cookieSecret: 'cookiesecret',
    sessionSecret: 'sessionsecret',
    cookieKeyName: 'mongo-express'
  },
  options: {
    documentsPerPage: 10,
    editorTheme: "rubyblue",
    cmdType: 'eval',
    subprocessTimeout: 300
  }
};

And when i try to launch with: node app :

Mongo Express server listening on port 3000
Database connected!
{ [MongoError: field missing/wrong type in received authenticate command]
  name: 'MongoError',
  ok: 0,
  errmsg: 'field missing/wrong type in received authenticate command',
  code: 17 }
Admin Database connected
{ [MongoError: not authorized on admin to execute command { serverStatus: 1 }]
  name: 'MongoError',
  ok: 0,
  errmsg: 'not authorized on admin to execute command { serverStatus: 1 }',
  code: 13 }
GET / 200 81ms - 1.96kb
GET /stylesheets/bootstrap.css 304 11ms
GET /stylesheets/style.css 304 4ms
GET /javascripts/jquery-1.7.2.min.js 304 4ms
GET /javascripts/bootstrap.min.js 304 6ms
GET /stylesheets/bootstrap-responsive.min.css 304 5ms

Thank you.

A question for the moderators!

Hello!

Was just wondering if the pull requests are going to be merged! Is this project not being managed by anybody? I feel like it has a lot of potential and would hate to see it not being active!

Thanks!

fails to start

Failed to load c++ bson extension, using pure JS version
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
Mongo Express server listening on port 8081
events.js:85
throw er; // Unhandled 'error' event
^
Error: listen EACCES
at exports._errnoException (util.js:746:11)
at Server._listen2 (net.js:1139:19)
at listen (net.js:1182:10)
at Server.listen (net.js:1267:5)
at Function.app.listen (C:\node\mongo\node_modules\mongo-express\node_module
s\express\lib\application.js:533:24)
at Object. (C:\node\mongo\node_modules\mongo-express\app.js:315:7
)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)

Apple app rejected because of node.js and mongo

I have submitted app more than 5 times because of node.js and mongodb, Apple review always giving me error of could not connect to server, Can you let me know is there is any issue with that codes,

Error: Invalid filter "to_string"

I get this error when I try to view collection.

Invalid filter "to_string" on line 150 in file: mongo-express/views/collection.html

install on ubuntu/debian has some error

I install on ubuntu and debian and have an error

sweb@sweb-laptop:~/mongoexpress$ node -v
v0.12.7
sweb@sweb-laptop:~/mongoexpress$ npm -v
2.13.5
sweb@sweb-laptop:~/mongoexpress$ npm install mongo-express

> [email protected] install /home/sweb/mongoexpress/node_modules/mongo-express/node_modules/mongodb/node_modules/kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory '/home/sweb/mongoexpress/node_modules/mongo-express/node_modules/mongodb/node_modules/kerberos/build'
  SOLINK_MODULE(target) Release/obj.target/kerberos.node
  COPY Release/kerberos.node
make: Leaving directory '/home/sweb/mongoexpress/node_modules/mongo-express/node_modules/mongodb/node_modules/kerberos/build'

> [email protected] install /home/sweb/mongoexpress/node_modules/mongo-express/node_modules/mongodb/node_modules/bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory '/home/sweb/mongoexpress/node_modules/mongo-express/node_modules/mongodb/node_modules/bson/build'
  CXX(target) Release/obj.target/bson/ext/bson.o
bson.target.mk:83: recipe for target 'Release/obj.target/bson/ext/bson.o' failed
make: Leaving directory '/home/sweb/mongoexpress/node_modules/mongo-express/node_modules/mongodb/node_modules/bson/build'
[email protected] node_modules/mongo-express
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

support to switch mongodb url

I had modify config.json to use process.env, then success to run at cloudfoundry.
and wonder if can add a feature to switch mongodb server, that just to say : provide a textfield at webpage, allow to connect to the new mongo server
so that I can use bind it to many cloundfoundry mongo service and use as a help tool

500 TypeError: Object #<Admin> has no method 'serverStatus'

Using:

MongoDB 2.4.8
Node 0.10.21

When I visit the index page with default configs I get the following returned.

at exports.index (/Users/Projects/node_modules/mongo-express/routes/index.js:30:15)
at callbacks (/Users/Projects/node_modules/mongo-express/node_modules/express/lib/router/index.js:162:37)
at middleware (/Users/Projects/node_modules/mongo-express/app.js:288:3)
at callbacks (/Users/Projects/node_modules/mongo-express/node_modules/express/lib/router/index.js:162:37)
at param (/Users/Projects/node_modules/mongo-express/node_modules/express/lib/router/index.js:136:11)
at pass (/Users/Projects/node_modules/mongo-express/node_modules/express/lib/router/index.js:143:5)
at nextRoute (/Users/Projects/node_modules/mongo-express/node_modules/express/lib/router/index.js:101:7)
at callbacks (/Users/Projects/node_modules/mongo-express/node_modules/express/lib/router/index.js:165:11)
at app.param.req.session.error (/Users/Projects/node_modules/mongo-express/app.js:207:10)
at callbacks (/Users/Projects/node_modules/mongo-express/node_modules/express/lib/router/index.js:162:37)

Cannot view/delete item if its _id is not an ObjectId

Right now view/delete require the _id to contain a full ObjectId. It would be nice to provide support for scenarios that do not use an ObjectId, such as when using connect-mongo for sessions in a project. connect-mongo uses a 24-digit string, but not a full ObjectId.

Upon install: 500 Error Object Admin has no method server status

I have installed mongo-express as a module in my project and when I try and load the page on 8081 I get the following error:

Express
500 TypeError: Object # has no method 'serverStatus'

I probably have something configured incorrectly but if I modify the index.js route lines 30:38 and just render the index view I can get everything to work fine. I just thought I would check with you and see if this is a common problem or I have something set wrong in config.js that typically causes this issue.

I am on node 0.10.15.

crash on collection rename

When renaming collection:

...\mongo-express\routes\collection.js:150
req.session.success('Collection renamed!');
^
TypeError: Object # has no method 'success'
at exports.renameCollection (D:\SITES\mongo-express\routes\collection.js:150:19)
at updateCollections (D:\SITES\mongo-express\app.js:94:7)
at Db.collectionNames (D:\SITES\mongo-express\node_modules\mongodb\lib\mongodb\db.js:397:7)
at Cursor.toArray (D:\SITES\mongo-express\node_modules\mongodb\lib\mongodb\cursor.js:129:9)
at Cursor.each (D:\SITES\mongo-express\node_modules\mongodb\lib\mongodb\cursor.js:171:11)
at Cursor.nextObject (D:\SITES\mongo-express\node_modules\mongodb\lib\mongodb\cursor.js:463:35)
at Cursor.close (D:\SITES\mongo-express\node_modules\mongodb\lib\mongodb\cursor.js:682:5)
at Cursor.nextObject (D:\SITES\mongo-express\node_modules\mongodb\lib\mongodb\cursor.js:463:17)
at Cursor.each (D:\SITES\mongo-express\node_modules\mongodb\lib\mongodb\cursor.js:162:12)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)

Windows7, NodeJS 0.8.8, Express 3.0.0alpha1, Chrome 21
Express 3.0.0rc4 emits another errors :)

Great project, keep it going.
NodeJS and Web GUI are the most proper basis for mongoDB administration.

Support for complex queries?

i.e. {name: {$exists: 1}} - is this possible today? or is it a planned feature? happy to help if it's on the roadmap.

Inactive development

Hey,
Is this project totally inactive now? It's been 7 months now since the last commit.
I would like to see it active again :)

Thanks!

Cannot npm install on Ubuntu 14.04/NPM 2.7.4/Node 0.12.2

programmer@programmer:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.2 LTS
Release:    14.04
Codename:   trusty
programmer@programmer:~$ npm --version
2.7.4
programmer@programmer:~$ node --version
v0.12.2
programmer@programmer:~$ npm install mongo-express --verbose --debug
npm info it worked if it ends with ok
npm verb cli [ '/home/programmer/.nvm/versions/node/v0.12.2/bin/node',
npm verb cli   '/home/programmer/.nvm/versions/node/v0.12.2/bin/npm',
npm verb cli   'install',
npm verb cli   'mongo-express',
npm verb cli   '--verbose',
npm verb cli   '--debug' ]
npm info using [email protected]
npm info using [email protected]
npm verb config Skipping project config: /home/programmer/.npmrc. (matches userconfig)
npm verb cache add spec mongo-express
npm verb addTmpTarball /home/programmer/mongo-express not in flight; adding
npm verb addTmpTarball validating metadata from /home/programmer/mongo-express
npm verb tar unpack /home/programmer/mongo-express
npm verb tar unpacking to /tmp/npm-14310-512c5e2c/unpack-99d2e51d4c49
npm verb gentlyRm don't care about contents; nuking /tmp/npm-14310-512c5e2c/unpack-99d2e51d4c49
npm ERR! not a package /home/programmer/mongo-express
npm ERR! addLocal Could not install /home/programmer/mongo-express
npm verb stack Error: ENOENT, open '/tmp/npm-14310-512c5e2c/unpack-99d2e51d4c49/package.json'
npm verb stack     at Error (native)
npm verb cwd /home/programmer
npm ERR! Linux 3.13.0-55-generic
npm ERR! argv "/home/programmer/.nvm/versions/node/v0.12.2/bin/node" "/home/programmer/.nvm/versions/node/v0.12.2/bin/npm" "install" "mongo-express" "--verbose" "--debug"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! path /tmp/npm-14310-512c5e2c/unpack-99d2e51d4c49/package.json
npm ERR! code ENOENT
npm ERR! errno -2

npm ERR! enoent ENOENT, open '/tmp/npm-14310-512c5e2c/unpack-99d2e51d4c49/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 
npm verb exit [ -2, true ]

npm ERR! Please include the following file with any support request:
npm ERR!     /home/programmer/npm-debug.log

Unable to find documents by _id

Great project, but I have what feels like a silly issue. I can't query by _id?

I've tried using a value with ObjectId("xxx"), "xxx", xxx and nothing works. What am I doing wrong or is this a bug?

Thanks.

Allow to view and edit collections in tables

The RethinkDB UI has both the json view and a traditional table view.
For first level fields it would be nice for non developers to be able to add, manipulate data from a UI like mongo-express but with the ease of a spreadsheet.

See here:
https://www.evernote.com/shard/s1/sh/4ccd7e15-8984-429e-b52f-ab78ea18f01f/57c4778dd42a0d9a4e204536a7507874/deep/0/RethinkDB-Administration-Console.png

Or the way https://github.com/neumino/chateau/ does it for sub documents:
https://www.evernote.com/shard/s1/sh/3ca0dee1-d0ad-40ac-a6c2-cc68b607b01f/70173c99a8281cb3245a7db42a2024a3/deep/0/Chateau---Data-explorer-for-RethinkDB.png

How to start?

Hi! Can you explain how to start it as server ?

orangeudav@mbp ~$ npm install -g mongo-express
npm http GET https://registry.npmjs.org/mongo-express
npm http GET https://registry.npmjs.org/mongo-express
npm http GET https://registry.npmjs.org/mongo-express
npm http GET https://registry.npmjs.org/express/3.0.0
npm http GET https://registry.npmjs.org/consolidate
npm http GET https://registry.npmjs.org/mongodb
npm http GET https://registry.npmjs.org/swig
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/consolidate
npm http GET https://registry.npmjs.org/express/3.0.0
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/mongodb
npm http GET https://registry.npmjs.org/swig
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/swig
npm http GET https://registry.npmjs.org/consolidate
npm http GET https://registry.npmjs.org/express/3.0.0
npm http GET https://registry.npmjs.org/mongodb
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/async
npm WARN package.json [email protected] No README.md file found!
npm http GET https://registry.npmjs.org/range-parser/0.0.4
npm http GET https://registry.npmjs.org/mkdirp/0.3.3
npm http GET https://registry.npmjs.org/cookie/0.0.4
npm http GET https://registry.npmjs.org/crc/0.2.0
npm http GET https://registry.npmjs.org/fresh/0.1.0
npm http GET https://registry.npmjs.org/methods/0.0.1
npm http GET https://registry.npmjs.org/send/0.1.0
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/connect/2.6.0
npm http GET https://registry.npmjs.org/commander/0.6.1
npm http GET https://registry.npmjs.org/bson/0.0.4
npm http GET https://registry.npmjs.org/range-parser/0.0.4
npm http GET https://registry.npmjs.org/mkdirp/0.3.3
npm http GET https://registry.npmjs.org/fresh/0.1.0
npm http GET https://registry.npmjs.org/crc/0.2.0
npm http GET https://registry.npmjs.org/cookie/0.0.4
npm http GET https://registry.npmjs.org/methods/0.0.1
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/connect/2.6.0
npm http GET https://registry.npmjs.org/commander/0.6.1
npm http GET https://registry.npmjs.org/bson/0.0.4
npm http GET https://registry.npmjs.org/send/0.1.0
npm http 304 https://registry.npmjs.org/crc/0.2.0
npm http 304 https://registry.npmjs.org/mkdirp/0.3.3
npm http 304 https://registry.npmjs.org/range-parser/0.0.4
npm http 304 https://registry.npmjs.org/fresh/0.1.0
npm http 200 https://registry.npmjs.org/cookie/0.0.4
npm http GET https://registry.npmjs.org/cookie/-/cookie-0.0.4.tgz
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/methods/0.0.1
npm WARN package.json [email protected] No README.md file found!
npm http 304 https://registry.npmjs.org/connect/2.6.0
npm http 304 https://registry.npmjs.org/commander/0.6.1
npm http 304 https://registry.npmjs.org/bson/0.0.4
npm WARN package.json [email protected] No README.md file found!

> [email protected] install /usr/local/share/npm/lib/node_modules/mongo-express/node_modules/mongodb/node_modules/bson
> node install.js

================================================================================
=                                                                              =
=  To install with C++ bson parser do <npm install mongodb --mongodb:native>   =
=                                                                              =
================================================================================
npm http 200 https://registry.npmjs.org/cookie/-/cookie-0.0.4.tgz
npm http 304 https://registry.npmjs.org/send/0.1.0
npm http GET https://registry.npmjs.org/mime/1.2.6
npm http GET https://registry.npmjs.org/qs/0.5.1
npm http GET https://registry.npmjs.org/bytes/0.1.0
npm http GET https://registry.npmjs.org/formidable/1.0.11
npm http GET https://registry.npmjs.org/send/0.0.4
npm http GET https://registry.npmjs.org/pause/0.0.1
npm http 304 https://registry.npmjs.org/mime/1.2.6
npm http 304 https://registry.npmjs.org/formidable/1.0.11
npm http 304 https://registry.npmjs.org/send/0.0.4
npm http 304 https://registry.npmjs.org/qs/0.5.1
npm http 304 https://registry.npmjs.org/bytes/0.1.0
npm http 304 https://registry.npmjs.org/pause/0.0.1
[email protected] /usr/local/share/npm/lib/node_modules/mongo-express
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
orangeudav@mbp ~$ mongo-express
-bash: mongo-express: command not found

npm install fails with swig incompatibility

When I attempt to "npm install mongo-express", I get this error:

npm ERR! Error: No compatible version found: swig@'>=0.11.0- <0.12.0-'

I am using the Ubuntu 12.0.4, and am on nodejs 0.8.0.

I was able to install on another box that is also Ubuntu 12.04, but it was using nodejs 0.6.x.

I am wondering if it has something to do with the latest version of node?

Below is the entire output from my npm install Error:

ubuntu@ip-10-176-189-177:/var/app/borc$ sudo npm install mongo-express
npm http GET https://registry.npmjs.org/mongo-express
npm http 304 https://registry.npmjs.org/mongo-express
npm http GET https://registry.npmjs.org/express/3.0.0alpha1
npm http GET https://registry.npmjs.org/mongodb
npm http GET https://registry.npmjs.org/swig
npm http GET https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/express/3.0.0alpha1
npm http 304 https://registry.npmjs.org/mongodb
npm http 304 https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/swig
npm ERR! Error: No compatible version found: swig@'>=0.11.0- <0.12.0-'
npm ERR! Valid install targets:
npm ERR! ["0.1.1","0.1.2","0.1.3","0.1.5","0.1.6","0.1.7","0.1.8","0.1.9","0.2.0","0.2.1","0.2.2","0.2.3","0.3.0","0.4.0","0.5.0","0.6.0","0.6.1","0.7.0"]
npm ERR! at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:506:10)
npm ERR! at next_ (/usr/local/lib/node_modules/npm/lib/cache.js:452:17)
npm ERR! at next (/usr/local/lib/node_modules/npm/lib/cache.js:427:44)
npm ERR! at /usr/local/lib/node_modules/npm/lib/cache.js:419:5
npm ERR! at saved (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:136:7)
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:230:7
npm ERR! at Object.oncomplete (fs.js:297:15)
npm ERR! [Error: No compatible version found: swig@'>=0.11.0- <0.12.0-'
npm ERR! Valid install targets:
npm ERR! ["0.1.1","0.1.2","0.1.3","0.1.5","0.1.6","0.1.7","0.1.8","0.1.9","0.2.0","0.2.1","0.2.2","0.2.3","0.3.0","0.4.0","0.5.0","0.6.0","0.6.1","0.7.0"]]
npm ERR! You may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Linux 3.2.0-23-virtual
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "mongo-express"
npm ERR! cwd /var/app/borc
npm ERR! node -v v0.8.0
npm ERR! npm -v 1.1.32
npm ERR! message No compatible version found: swig@'>=0.11.0- <0.12.0-'
npm ERR! message Valid install targets:
npm ERR! message ["0.1.1","0.1.2","0.1.3","0.1.5","0.1.6","0.1.7","0.1.8","0.1.9","0.2.0","0.2.1","0.2.2","0.2.3","0.3.0","0.4.0","0.5.0","0.6.0","0.6.1","0.7.0"]
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /var/app/borc/npm-debug.log
npm ERR! not ok code 0

No databases showing

Hello,

I've been able to successfully run the mongo-express app (it also says in the console "database connected"). Although, when I open the web page it only appears the right column statistics, the side bar contains no items / database.

Why could that be?

Thanks,
J.

White/Black List Bug

When using white/black list _ is not defined:
ReferenceError: _ is not defined
at /home/_/webapps/_/db.js:62:16

Add cli

You should add a command line interface so that the server can be easily started without having to explicitly run the javascript file!

AuthenticationFailed MONGODB-CR credentials missing in the user document

I'm trying out a single MongoDB instance on my server and using Mongo 3.0.3 to set up.

mongo-express couldn't seem to authenticate any of my users – admin or otherwise – I've checked the instructions in config.js and followed them, but I'm not getting any further beyond an empty mongo-express homepage. Attempting to click on the listed databases (which I've populated using the auth array) crashes mongo-express.

The error log from mongo-express as it starts up reads:

{ [MongoError: auth failed] name: 'MongoError', ok: 0, errmsg: 'auth failed', code: 18 } mongo-express-0 (err): Could not authenticate to database "dbname"

Cross-referencing the mongod logs revealed this error:
AuthenticationFailed MONGODB-CR credentials missing in the user document

Am I totally missing something in my configuration? I've tried all manner of user types in config.js:

  • root superuser, created in the admin db, declared in adminUserName/adminPassword
  • dbOwner poweruser, created in my db, declared in auth array
  • readWrite regular user, created in my db, declared in auth array

I have absolutely no issues in accessing my mongodb instance, authenticating and traversing different databases via mongoshell, which is why I'm hoping someone here can help me out. Thanks for reading~

Automatically update databases and collections

Currently in the version 0.21.0 seems like there is no way to automatically update created created collections and databases after the mongo-express server boot.

Ideally it should perform an update, for instance, on each time frame interval, to avoid the annoying process of restarting the server manually each time.

Confirm delete

There should be a confirm before deleting documents or collections.

For Collections I would suggest to ask the user to enter 'DELETE' before deleting. Documents can be a simple confirm (Really?).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.