2013-01-12 49 views
1

我一直在與德比開玩笑一段時間,目前正試圖將我的頭圍繞整個賽車存儲的東西。雖然我喜歡在客戶端沒有任何硬編碼MongoDB查詢的想法,但我無法完成所有工作。DerbyJS - 無法讓Mongo存儲工作

我一再得到Error: No persistence handler for set(meta,[object Object],1)消息,現在已經試圖將其歸結爲一個最小的例子。這是我server/index.js的相關部分:

var http = require('http') 
    , path = require('path') 
    , express = require('express') 
    , gzippo = require('gzippo') 
    , derby = require('derby') 
    , api = require('../api') 
    , app = require('../app') 
    , serverError = require('./serverError') 


// SERVER CONFIGURATION // 

var expressApp = express(); 
var server = module.exports = http.createServer(expressApp); 

derby.use(derby.logPlugin); 


// Setting up MongoDB storage 
derby.use(require('racer-db-mongo')); 
var store = derby.createStore({ 
    listen: server 
    , db: { 
     type: 'Mongo' 
    , uri: 'mongodb://localhost/webIsoRogue' 
    } 
}); 

// Trying to insert some dummy data 
var model = store.createModel(); 
model.set('meta', { 
    app: { 
    title: 'Hi there' 
    , author: 'Erik Mathers' 
    } 
}); 

console.log(model.get('meta.app')); 

我已經驗證多次的MongoDB的服務器正在運行和訪問,這是!

只要我嘗試存儲虛擬數據,我會收到不太有用的錯誤消息:Error: No persistence handler for set(meta,[object Object],1)

有人可以告訴我我要去哪裏嗎?

回答

0

Try:'mongodb://localhost:27017/webIsoRogue'