[Developers] Getting Spouses

John Giannandrea jg at metaweb.com
Wed Sep 12 19:14:15 UTC 2007


Ketan Anjaria wrote:
> But the result is not what I expect, I am getting
> /people/person/spouse_s":[{
>       "/common/topic/image":[],
>       "id":"#9202a8c04000641f8000000004206eef",
>       "name":null
>     }],
> For a spouse. Why is the name null?

because spouse is a compound value object which represents the marriage.
http://www.mjtemplate.org/examples/schemas/type.html?id=/people/marriage

You need something like this:

     "/people/person/spouse_s":[{
       "spouse":[{
         "/common/topic/image":[{
           "guid":null,
           "limit":1,
           "optional":true
         }],
         "id":null,
         "name":null,
         "optional":true
       }]
     }],

Also, spouse is quite unusual since it is symmetrical, you will get  
both parties back and have to skip over the one that you started with  
(Danny).

-jg



More information about the Developers mailing list