English 中文(简体)
如何管理县长官?
原标题:How to run the mongodb-rest?

I m new to node, I follow the official Guide on the README file, 我认为,mongodb-rest已经成功安装,但pm显示:

npm ls
/usr/local/bin
(empty)

这里所列的没有定额备用金

I simply don t know how to fire up the server as the guide says

 After that you can just issue mongodb-rest on the command line and the server should start.

I try node mongodb-rest or even type mongodb-rest in the node console, but either one works. Help!

Update--

由于有人回答我的问题,我认为我成功地通过 n安装了“mongodb-rest”一揽子备用金,并按“mongodb-rest<>/code”类型启用了“mongodb-rest,并在另一个窗口使用“ cur”作为README书写器,提出“要求”。

curl -d  { "A1" : 201 }  -H "Content-Type: application/json" http://localhost:3000/test/example1

页: 1

以及服务器中的信息:

node.js:134
        throw e; // process.nextTick error, or  error  event on first tick
        ^
TypeError: Cannot call method  authenticate  of null
    at /usr/local/lib/node_modules/mongodb-rest/lib/rest.js:72:10
    at /usr/local/lib/node_modules/mongodb-rest/node_modules/mongodb/lib/mongodb/db.js:176:16
    at [object Object].<anonymous> (/usr/local/lib/node_modules/mongodb-rest/node_modules/mongodb/lib/mongodb/connection/server.js:366:7)
    at [object Object].emit (events.js:81:20)
    at [object Object].<anonymous> (/usr/local/lib/node_modules/mongodb-rest/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:97:15)
    at [object Object].emit (events.js:67:17)
    at Socket.<anonymous> (/usr/local/lib/node_modules/mongodb-rest/node_modules/mongodb/lib/mongodb/connection/connection.js:399:12)
    at Socket.emit (events.js:64:17)
    at Array.<anonymous> (net.js:831:12)
    at EventEmitter._tickCallback (node.js:126:26)
最佳回答

在全球安装模块时,使用<代码>-g选项。 “mongodb-rest”的读物没有具体说明:a。

$ [sudo] npm -g install mongodb-rest

之后,指挥系统<代码>mongodb-rest应当运行。

BTW,为了获得全球安装模块清单,在<代码>l<>/code>上添加<编码>-g选项。

$ npm -g ls
问题回答

暂无回答




相关问题
Access DB Ref MongoDB

Whats the best way to access/query a DB Ref: UPDATE: users: name, groupref : {$ref:"groups",$id:"ObjectId ..." } } groups: name, topic, country,...,.. Assumption is that user belongs to only one ...

MongoDB nested sets

What re the best practices to store nested sets (like trees of comments) in MongoDB? I mean, every comment can have a parent comment and children-comments (answers). Storing them like this: { ...

MongoMapper and migrations

I m building a Rails application using MongoDB as the back-end and MongoMapper as the ORM tool. Suppose in version 1, I define the following model: class SomeModel include MongoMapper::Document ...

MongoDB takes long for indexing

I have the following setup: Mac Pro with 2 GB of RAM (yes, not that much) MongoDB 1.1.3 64-bit 8 million entries in a single collection index for one field (integer) wanted Calling .ensureIndex(...) ...

Storing and accessing large amounts of data

My application creates pieces of data that, in xml, would look like this: <resource url="someurl"> <term> <name>somename</name> <frequency>somenumber</...

热门标签