+1. Is there a Github issue for this? I couldn't fine one.
On Thursday, December 10, 2015 at 4:06:07 PM UTC-5, Ben Kennedy wrote:
>
> Hey folks,
>
> Let's say I wish to create a CBLModel subclass for a CBLDocument
> representing this structure:
>
> {
> "antelope" : {
> "alpha" : "one",
> "beta" : "two"
> },
> "edibles" : {
> "meat" : "flesh",
> "leaves" : "vegetables"
> },
> "beer" : "flanders sour ale"
> }
>
> In my client code, I want to be able to e.g. fetch vegetables as NSString
> *vegetables = someModel.edibles.leaves; .
>
> While it is obvious from the documentation that I can create a CBLModel
> subclass with a @property NSString *beer, it is not clear to me how to
> describe the first two dictionaries.
>
> It strikes me that I might be advised to create AntelopeModel and
> EdiblesModel subclasses of MYDynamicObject, and then declare such
> properties in my CBLModel subclass. This does not work, though, because
> the linker can't find MYDynamicObject when I build. (Obviously these
> subclasses cannot descend from CBLModel, since they are not documents
> themselves).
>
> What is the correct way to do this?
>
> Next, I have an ancillary question: is it possible, or even valid, to
> acquire a CBLModel object representing a specific CBLRevision of its
> CBLDocument?
>
> When the time comes to resolve conflicts between versions of my document,
> I wish to be able to call its synthesized properties in my business logic
> (much as I illustrated above with the vegetables). However, since conflict
> resolution deals in CBLRevisions, it is not clear to me how this is
> possible. It appears I am left to traverse the revision.properties array
> directly in this case, which makes the overall value of CBLModel rather
> dubious, if I end up having to write everything two ways.
>
> Do I overlook something?
>
> thanks,
>
> -ben
>
>
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/4d20eebf-9064-41f1-a4ec-b0df316d65bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.