2014-01-07 29 views
1

使用mongodb erlang驅動程序我的程序能夠連接mongodb數據庫服務器。 連接成功後,我嘗試了集合中的所有文檔。無法執行mongo:在erlang中查找函數

我嘗試下面的代碼:

mongo:do (safe, master, Conn, graph, fun() -> 
    process(mongo:find (pedgedata0, {src,1})) end), 

這裏 '圖' 是dbname和 'pedgedata0' 是集合。

我有不同的選項試圖像

mongo:do (safe, master, Conn, 'graph', fun() -> 
    process(mongo:find ('pedgedata0', {})) end), 

*這裏我試着用單引號DB和集合名稱,並指定了一個空的條件。

但是我得到以下錯誤:

Conn is : <0.104.0> 
** exception exit: undef 
    in function bson_binary:put_cstring/1 
     called as bson_binary:put_cstring(<<"graph.pedgedata0">>) 
    in call from mongo_protocol:put_message/3 
    in call from mongo_connection:encode_request/2 
    in call from mongo_connection:handle_call/3 
    in call from gen_server:handle_msg/5 
    in call from proc_lib:init_p_do_apply/3 

我正在從erlide這個程序(Eclipse的插件用於二郎)。

請幫我解決這個問題

回答