existing table and columns

40 views
Skip to first unread message

ENTR0PY

unread,
Nov 19, 2014, 9:35:28 PM11/19/14
to chica...@googlegroups.com
hello i have a table named rating
with the columns :
  _id
 rating

  my model is below , but when i do boss_db:find(rating,[]).
it retuns an empty list []

for completeness the table has 2 records

-module(rating , [Id , Rating]).
-table("rating").
 -columns([{id , "id"} , {rating , "rating"}]).
-compile(export_all).



David Welton

unread,
Nov 20, 2014, 2:43:16 AM11/20/14
to chica...@googlegroups.com
The column should be 'id', not _id, I would think, depending on the database.
> --
> 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 chicagoboss...@googlegroups.com.
> 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/73a43839-6d15-4c13-b6ab-46846bf09551%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
David N. Welton

http://www.welton.it/davidw/

http://www.dedasys.com/

ENTR0PY

unread,
Nov 20, 2014, 7:57:34 AM11/20/14
to chica...@googlegroups.com
Yeah , the database is MongoDb and it makes the collection/table key as _id

ENTR0PY

unread,
Nov 20, 2014, 10:07:44 AM11/20/14
to chica...@googlegroups.com
Does the feature actually work, was it ready for use?


On Wednesday, November 19, 2014 10:35:28 PM UTC-4, ENTR0PY wrote:

David Welton

unread,
Nov 20, 2014, 10:10:29 AM11/20/14
to chica...@googlegroups.com
It works for Postgres - I have no idea about MongoDB (well, actually I
have some ideas about MongoDB but they're not very pleasant ones:-)

Anyone with Mongo experience care to comment?
> --
> 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 chicagoboss...@googlegroups.com.
> 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/aa84b4a5-e3af-476c-81ce-6abe95e23e71%40googlegroups.com.

ENTR0PY

unread,
Nov 20, 2014, 10:32:14 AM11/20/14
to chica...@googlegroups.com
As far as you know , am i using it correctly ? based on what i have said so far......
As for mongo i understand


On Wednesday, November 19, 2014 10:35:28 PM UTC-4, ENTR0PY wrote:

Nicholas Whittier

unread,
Nov 21, 2014, 12:32:42 PM11/21/14
to chica...@googlegroups.com
This is ancient, but back in the 0.8 CB days, I put together a sample todo app with mongodb that was functional.

Code:

I keep meaning to update some of this, but there's a pre-built Amazon ami that should launch with a working version of the todo app against PostgreSQL, MySQL, and MongoDB here: http://imperialwicket.com/the-mob/ . I haven't tested that in ages, but if you want to glance at something that should be working against MongoDB out of the box, that's one example (I think there are a few others on GH).

At a glance, I managed the columns differently, though I don't see that as an immediate issue. If you can post a little more detail, maybe we can troubleshoot more effectively. Also remember that if you reference the code linked above, it was working against very old CB and boss_db commits/releases. I think some functions have changed since then.

This is all to say, if it's not working then it's a regression, because it used to work properly.

-- Nicholas

ENTR0PY

unread,
Nov 22, 2014, 8:06:52 AM11/22/14
to chica...@googlegroups.com
I have a working CB and MongoDB application.

 This is a second project we are starting, we have the data in mongodb and was hoping to have CB interact wtih it.

 It seems this feature (table and columns overriding) does not work with NOSQL data stores at least not with MongoDB.

 I created a test DB in mysql and the feature works for the most part, the only downside is we cant seem to override the 'id' field  requirements in models...
 we have tried -columns([{id,"myid"}] with no success , "myid" would be the current attribute name in the table


On Wednesday, November 19, 2014 10:35:28 PM UTC-4, ENTR0PY wrote:
Reply all
Reply to author
Forward
0 new messages