Skip to content

Instantly share code, notes, and snippets.

@drapp
Created March 8, 2012 00:49
Show Gist options
  • Save drapp/1997643 to your computer and use it in GitHub Desktop.
Save drapp/1997643 to your computer and use it in GitHub Desktop.
StackMob Select Example Responses
{
"username": "fred",
"email": "fred@example.com",
"bestfriend":
{
"username": "bob",
"email": "bob@example.com",
"bestfriend": "fred",
"friends": ["peggy", "betty", "earl"]
},
"friends": [
{
"username": "mary",
"email": "mary@example.com",
"bestfriend": "carl",
"friends": ["bob", "fred", "peggy"]
},
{
"username": "betty",
"email": "betty@example.com",
"bestfriend": "mary",
"friends": ["carl", "peggy", "earl"]
},
{
"username": "carl",
"email": "carl@example.com",
"bestfriend": "betty",
"friends": ["mary", "fred", "bob"]
}
]
}
{
"username": "fred",
"email": "fred@example.com"
}
String[] fields = new String[]{"friends","friends.email"};
StackMobQuery q = new StackMobQuery("user/fred").select(Arrays.asList(fields)).expandDepthIs(1);
StackMobCommon.getStackMobInstance().get(q, new StackMobCallback() { ...
{
"username": "fred",
"friends": [
{
"username": "mary",
"email": "mary@example.com"
},
{
"username": "betty",
"email": "betty@example.com"
},
{
"username": "carl",
"email": "carl@example.com"
}
]
}
{
"username": "fred",
"email": "fred@example.com",
"bestfriend":
{
"username": "bob",
"email": "bob@example.com",
"bestfriend": "fred",
"friends": ["peggy", "betty", "earl"]
}
}
{
"username": "fred",
"email": "fred@example.com",
"bestfriend": "bob"
"friends": ["mary", "betty", "carl"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment