As you can see there is not much to it*, *a very simple insert 

* Model*
------
-module(clientList, [Id, Listname, Email, Datablock]).
-compile(export_all).
-------



*Controller--------*-module(pigeon_mdbtest_controller, [Req]).

-export([hello/2]).

hello('GET', [])->
            ClientList = clientList:new(id, 
"Bill","[email protected]",[{"0","Field1"},{"1","Field2"},{"2","Field3"}]),
            boss_db:transaction ( fun()-> ClientList:save() end),
            {output, ["test done"]}.
------

Error
------
[error] Error in controller error function_clause 
 [{bson_binary,put_field_accum,
              ["0","Field1",<<>>],
              [{file,"src/bson_binary.erl"},{line,93}]},
 {bson,doc_foldlN,5,[{file,"src/bson.erl"},{line,37}]},
 {bson_binary,put_document,1,
              [{file,"src/bson_binary.erl"},{line,91}]},
 {bson_binary,put_field,2,
              [{file,"src/bson_binary.erl"},{line,33}]},
 {bson_binary,put_value_accum,2,
              [{file,"src/bson_binary.erl"},{line,115}]},
 {lists,foldl,3,[{file,"lists.erl"},{line,1261}]},
 {bson_binary,put_array,1,
              [{file,"src/bson_binary.erl"},{line,112}]},
 {bson_binary,put_field,2,
              [{file,"src/bson_binary.erl"},{line,34}]}]


-------


On Thursday, 21 August 2014 08:49:10 UTC+10, Kai Janson wrote:
>
> Care to share your model and controller code in question?
>
> Sent from my non-google-device
>
> On Aug 20, 2014, at 18:18, jason stewart <[email protected] <javascript:>> 
> wrote:
>
> I tried that with 
>
> ClientList = clientList:new(id, "Bill","[email protected]
> ",{{"0","Field1"},{"1","Field2"},{"2","Field3"}})
>
> but then I get a bson error message
>
> [error] Error in controller error function_clause 
> [{bson_binary,put_field_accum,["0","Field1",<<>>],[{file,"src/bson_binary.erl"},{line,93}]}
>
>
>
> On Wednesday, 20 August 2014 03:48:18 UTC+10, can2nac wrote:
>>
>> try [{"0","Field1"},{"1","Field2"},{"2","Field3"}]
>>
>> On Tuesday, August 19, 2014 3:30:44 AM UTC+4, jason stewart wrote:
>>>
>>> I am trying to add an bson object to a field in my mongodb database 
>>> using bossRecord 
>>>
>>> Model
>>>
>>>      -module(clientList, [Id, Listname, Email, Datablock]).
>>>      -compile(export_all).
>>>
>>> Code
>>>
>>>     ClientList = clientList:new(id, "Bill","[email protected]
>>> ",{{"0","Field1"},{"1","Field2"},{"2","Field3"}})
>>>     boss_db:transaction ( fun()-> ClientList:save() end).
>>>
>>> Error
>>>
>>>     [error] Error in controller error undef
>>>
>>>
>>> I understand that a bossRecord is not the same as a bson object, but I 
>>> am unsure how to get it in there, is there a converter, do I need to create 
>>> a new boss record.
>>>
>>> Also if anyone know any site that explains anything to do with Chicago 
>>> boss database access could you let me know, I am finding that the 
>>> documentation for it is useless or its just  I am not getting it 
>>>
>>>  -- 
> You received this message because you are subscribed to the Google Groups 
> "ChicagoBoss" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> Visit this group at http://groups.google.com/group/chicagoboss.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/chicagoboss/48ae2c19-0fb0-4e42-99fd-e3e011d924bf%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/chicagoboss/48ae2c19-0fb0-4e42-99fd-e3e011d924bf%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/chicagoboss/2905c933-35c2-4dde-840b-4167ebdfcded%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to