Search.../

items

Returns the items that match the reference query.

Description

The current page of items retrieved by the reference query.

The page size is 50 items. Navigate through pages of items with the prev() and next() functions.

When no items match the reference query, the items array is empty.

Type:

Array<Object>Read Only

Was this helpful?

Get the items of a reference query result

Copy Code
1let items = results.items;
2
3/*
4 * [
5 * {
6 * "_id": "1234",
7 * "_owner": "f45jf8d2-grkj-2opd-4ovk-9rfj4wo5tvj3",
8 * "_createdDate": "2017-05-29T08:35:52.344Z",
9 * "_updatedDate": "2017-05-29T08:35:52.344Z",
10 * "first_name": "Jane",
11 * "last_name": "Doe"
12 * },
13 * {
14 * "_id": "5678",
15 * "_owner": "f45jf8d2-grkj-2opd-4ovk-9rfj4wo5tvj3",
16 * "_createdDate": "2017-05-25T12:48:56.572Z",
17 * "_updatedDate": "2017-05-29T07:30:15.869Z",
18 * "first_name": "John",
19 * "last_name": "Doe"
20 * }
21 * ]
22 */
Perform a reference query and get the items of the result

Copy Code
1import wixData from 'wix-data';
2
3// ...
4
5wixData.queryReferenced("movies", "00001", "actors")
6 .then((results) => {
7 if(results.items.length > 0) {
8 console.log(results.items); // see below
9 } else {
10 // handle case where no matching items found
11 }
12 }) ;
13
14/* items:
15 *
16 * [
17 * {
18 * "_id": "1234",
19 * "_owner": "f45jf8d2-grkj-2opd-4ovk-9rfj4wo5tvj3",
20 * "_createdDate": "2017-05-29T08:35:52.344Z",
21 * "_updatedDate": "2017-05-29T08:35:52.344Z",
22 * "first_name": "Jane",
23 * "last_name": "Doe"
24 * },
25 * {
26 * "_id": "5678",
27 * "_owner": "f45jf8d2-grkj-2opd-4ovk-9rfj4wo5tvj3",
28 * "_createdDate": "2017-05-25T12:48:56.572Z",
29 * "_updatedDate": "2017-05-29T07:30:15.869Z",
30 * "first_name": "John",
31 * "last_name": "Doe"
32 * }
33 * ]
34 */