Search.../

items

Returns the items that match the query.

Description

The current page of groups retrieved by the query.

Note: When no items match the query, the items array is empty.

To paginate your query results, use the GroupsQueryResult pagination properties and functions.

Type:

Array<Group>Read Only
NAME
TYPE
DESCRIPTION
_id
string

Group ID.

name
string

Group name.

slug
string

Part of a group's URL, for example, 'https:/example.com/groups/{my-group-slug}'. Generally based on the group name, but for secret groups it is an autogenerated string of characters, for example, 'https:/example.com/groups/{5D3yTX}'. It is case-sensitive.

description
string

Group description.

privacyStatus
string

Group privacy level. One of:

  • PUBLIC: Site visitors can see the group and its content in the list of groups. Site members can join the group.
  • PRIVATE: Site visitors can see the group in the list of groups, but only group members can see its content. Site members can request to join the group.
  • SECRET: Only group members can see the group and its content in the list of groups. Site members can only join if invited by group admins, or other group members.
coverImage
CoverImage

Group cover image.

memberTitle
string

What group members are called. For example, 'Coworkers', 'Friends', or 'Students'.

memberCount
number

Number of members in the group.

settings
GroupSettings

Group settings.

lastActivityDate
Date

Date and time the group was last active. For example, a post or comment.

_createdDate
Date

Date and time the group was created.

_updatedDate
Date

Date and time the group was last updated.

owner
string

Site member ID of the group creator. Defaults to group creator.

Was this helpful?

Perform a query and get the returned items from the result

Copy Code
1import { Permissions, webMethod } from 'wix-web-module';
2import { groups } from 'wix-groups-backend';
3
4export const getQueryResultItems = webMethod(Permissions.Anyone, async () => {
5 try {
6 const options = {
7 suppressAuth: true
8 };
9
10 const results = await groups.queryGroups()
11 .limit(3)
12 .find(options);
13
14 if (results.items.length > 0) {
15 return results.items;
16 } else {
17 console.log("No items found");
18 }
19 } catch (error) {
20 console.error(error);
21 }
22});
23
24/* items:
25 * [
26 * {
27 * "coverImage":{
28 * "imageUrl": "wix:image://v1/jb9074e348009011fa9f2dzj0jn~mv2.jpg/nutmeg.jpg#originWidth=800&originHeight=720",
29 * "position": {
30 * "x": 200,
31 * "y": 350
32 * }
33 * },
34 * "_createdDate":"2021-10-06T09:33:16.000Z",
35 * "description":"Welcome to the group! You can connect with other members, get updates and share videos.",
36 * "_id":"7e75dade-5f62-4eb4-b861-fa35b36d1f8d",
37 * "lastActivityDate":"2021-10-06T09:33:16.000Z",
38 * "memberCount": 37,
39 * "memberTitle":"Members",
40 * "name":"Group1",
41 * "owner":"937cd3db-e9be-4980-93c1-a6d767a11050",
42 * "privacyStatus":"PUBLIC",
43 * "settings":{
44 * "groupUpdatePostEnabled": true,
45 * "membersCanApprove": false,
46 * "membersCanInvite": true,
47 * "showMemberList": true,
48 * "welcomeMemberPostEnabled": true
49 * },
50 * "slug":"group1",
51 * "_updatedDate": "2021-10-06T09:33:18.000Z"
52 * },
53 * "_id":"7e75dade-5f62-4eb4-b861-fa35b36d1f8d",
54 * "rejectionReason":"undefined",
55 * "status":"PENDING"
56 * },
57 * {
58 * "coverImage":{
59 * "imageUrl": "wix:image://v1/vcc6074e348009011fa9f2d29kk7~mv2.jpg/maple.jpg#originWidth=999&originHeight=240",
60 * "position": {
61 * "x": 20,
62 * "y": 35
63 * }
64 * },
65 * "_createdDate":"2021-09-04T09:31:11.000Z",
66 * "description":"Welcome to the group! You can connect with other members, get updates and share videos.",
67 * "_id":"50ba513d-e7e4-4970-9c69-deb25b047436",
68 * "lastActivityDate":2021-09-04T09:31:11.000Z",
69 * "memberCount": 102,
70 * "memberTitle":"Friends",
71 * "name":"Group2",
72 * "owner":"937cd3db-e9be-4980-93c1-a6d767a11050",
73 * "privacyStatus":"PUBLIC",
74 * "settings":{
75 * "groupUpdatePostEnabled": true,
76 * "membersCanApprove": false,
77 * "membersCanInvite": true,
78 * "showMemberList": true,
79 * "welcomeMemberPostEnabled": true
80 * },
81 * "slug":"group2",
82 * "_updatedDate": "2021-09-04T09:31:11.000Z"
83 * },
84 * "_id":"50ba513d-e7e4-4970-9c69-deb25b047436",
85 * "rejectionReason":"undefined",
86 * "status":"APPROVED"
87 * },
88 * {
89 * "coverImage":{
90 * "imageUrl": "wix:image://v1/ff9074e348009011fa9f2d2961b~mv2.jpg/oak.jpg#originWidth=400&originHeight=900",
91 * "position": {
92 * "x": 20,
93 * "y": 325
94 * }
95 * },
96 * "_createdDate":"2021-03-12T09:24:16.000Z",
97 * "description":"Welcome to the group! You can connect with other members, get updates and share videos.",
98 * "_id":"7e75dade-5f62-4eb4-b861-fa35b36d1f8d",
99 * "lastActivityDate":"2021-08-12T09:24:16.000Z",
100 * "memberCount": 8,
101 * "memberTitle":"Colleagues",
102 * "name":"Group3",
103 * "owner":"937cd3db-e9be-4980-93c1-a6d767a11050",
104 * "privacyStatus":"PUBLIC",
105 * "settings":{
106 * "groupUpdatePostEnabled": true,
107 * "membersCanApprove": false,
108 * "membersCanInvite": true,
109 * "showMemberList": true,
110 * "welcomeMemberPostEnabled": true
111 * },
112 * "slug":"group3",
113 * "_updatedDate":"2021-08-12T09:24:16.000Z"
114 * }
115 * ]
116 */