Simple Collection Viewer for MongoDB. Designed for users without knowledge about internals. There is no admin access to the MongoDB instance needed. Can also export an collection as CSV file. Use SMOG or Mongo-Express if you need a (full featured) MongoDB client.
not implented yet
Exports an collection as CSV file
$ npm install express-simplemongodbview
SimpleMongoDBView needs serveral modules, see dependencies
The app needs to know which models to use. So you need an js file with the model definitions. This file has to export the models like this example (databasemodels.js):
var db = Schema = dbSchema;var _MySchema =id : SchemaObjectIdtype : type: Number required: truename : type: String required: false trim: true index: sparse: truetimestamp : type: Date default: Datenow required: true;var MySchema = db;exportsMySchema = MySchema;
SimpleMongoDBView detect all schemas exported the way above.
Now, use it as standalone app:
var mongoose = ;var dbview = ;var config =modelDefinitionFile : __dirname + '/databasemodels.js'web:host : 'localhost'port : 80mongoose;
Available options as object:
- modelDefinitions: an existing object (require)
- modelDefinitionFile: a file with the model definitons (use only modelDefinitionFile OR modelDefinitions)
- web.host: The hostname, e.g. localhost
- web.port: The port, e.g. 8080
- web.cdnurl: The page uses some external js libs like jQuery, Backbone.js and Underscore.js. You can define an url to an external cdn to deliver these libs from there. Otherwise these libs are served from Express.
- auth.enabled: can be set to true and a basic authentification (Basic HTTP Auth) jumps in
- auth.user: the user name for authenticifation (default is admin)
- auth.password: the user password (default is admin)
You can also use this in your existing applications, change the port accordingly.
Copyright (c) 2013, Hendrik Konitzer