Skip to main content
Version: 5.7.0

GetRandomGroupsMatching

Gets a list of up to maxReturn randomly selected groups from the server based on the where condition.

ServiceOperation
groupGET_RANDOM_GROUPS_MATCHING

Method Parameters

ParameterDescription
whereMongo style query string.
maxReturnCount of groups to randomly select

Usage

http://localhost:3000
string where = "{\"groupType\":\"BLUE\"}";
int maxReturn = 20;
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.GroupService.GetRandomGroupsMatching(where, maxReturn, successCallback, failureCallback);
JSON Response
{
"data": {
"count": 1,
"groups": [
{
"gameId": "12345",
"groupId": "b7b590e0-0e27-47ef-8bf5-03a3b4e34475",
"ownerId": "77ce8889-20b7-4d01-b248-e0beb747f1b4",
"name": "myGroupName",
"groupType": "myGroupType",
"createdAt": 1561472696504,
"updatedAt": 1561472696504,
"members": {
"77ce8889-20b7-4d01-b248-e0beb747f1b4": {
"role": "OWNER",
"attributes": {}
}
},
"pendingMembers": {},
"version": 1,
"data": {},
"summaryData": {},
"isOpenGroup": true,
"defaultMemberAttributes": {},
"memberCount": 1,
"invitedPendingMemberCount": 0,
"requestingPendingMemberCount": 0,
"acl": {
"member": 2,
"other": 0
}
}
]
},
"status": 200
}