MongoDB and Models questions.

32 views
Skip to first unread message

na...@jeket.com

unread,
May 14, 2014, 12:05:23 PM5/14/14
to chica...@googlegroups.com
I'm still trying to figure out how to use CB. I really like it so far but i'm not sure how to do a few things.

  1. When you define a new model and it's attributes. ( -module(foo, [Id, SomeString::string(), ...]) ) is there a way to indicate if the attribute is optional? Right now if i don't use an attribute and save the record to the database. I'll get a null in the field. I would prefer if it just wasn't available.
  2. How do you deal with nested objects? how do you define a nested record and how would you get those nested values into your templates? So far all i've found was this:
    get(Path::string()) -> Value

    Returns a deeply nested value described by a dot-separated Path (e.g. "puppy.mother.name")


Thanks for any help!

can2nac

unread,
May 15, 2014, 11:18:01 AM5/15/14
to chica...@googlegroups.com
1. No as far as i know
2. I use Proplists as I haven't figured out how to define "Nested" object and there is nothing about this in Ref or Man.
Reply all
Reply to author
Forward
0 new messages