> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: queryReservationLocations(options: QueryReservationLocationsOptions) # Method package: wixTableReservationsV2 # Method menu location: wixTableReservationsV2 --> reservationLocations --> queryReservationLocations # Method Link: https://dev.wix.com/docs/velo/apis/wix-table-reservations-v2/reservation-locations/query-reservation-locations.md # Method Description: Creates a query to retrieve a list of reservation locations. The `queryReservationLocations()` function builds a query to retrieve a list of reservation locations and returns a [`ReservationLocationsQueryBuilder`](/reservation-locations/reservation-locations-query-builder/) object. The returned object contains the query definition, which is used to run the query using the [find()](/reservation-locations/reservation-locations-query-builder/find) function. You can refine the query by chaining `ReservationLocationsQueryBuilder` functions onto the query. `ReservationLocationsQueryBuilder` functions enable you to filter, sort, and control the results that `queryReservationLocations()` returns. `queryReservationLocations()` runs with the following `ReservationLocationsQueryBuilder` defaults, which you can override: * [`skip(0)`](/reservation-locations/reservation-locations-query-builder/skip) * [`limit(50)`](/reservation-locations/reservation-locations-query-builder/limit) The following `ReservationLocationsQueryBuilder` functions are supported for `queryReservationLocations()`. For a full description of the reservation location object, see the object returned for the [`items`](/reservation-locations/reservation-locations-query-result/items) property in [`ReservationLocationsQueryResult`](/reservation-locations/reservation-locations-query-result). |PROPERTY |SUPPORTED FILTERS & SORTING |:---:|:---:| |`_id`|[`eq()`](/reservation-locations/reservation-locations-query-builder/eq),[`ne()`](/reservation-locations/reservation-locations-query-builder/ne),[`in()`](/reservation-locations/reservation-locations-query-builder/in)| # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Query all reservation locations (page code) ```javascript import { reservationLocations } from 'wix-table-reservations-v2'; reservationLocations.queryReservationLocations().find() .then((retrievedReservationLocations) => { const nextCursor = retrievedReservationLocations._nextCursor; const minNotice = retrievedReservationLocations._items[0].configuration.onlineReservations.minimumReservationNotice; console.log('Success! Retrieved reservation locations from query:', retrievedReservationLocations); return retrievedReservationLocations; }) .catch((error) => { console.error(error); // Handle the error }); /* Promise resolves to: * { * "_items": [ * { * "location": { * "name": "Yunitsman Street", * "fax": "", * "timeZone": "Europe/Dublin", * "email": "", * "phone": "", * "address": { * "formatted": "Yunitsman Street 5, Tel Aviv-Yafo, Israel", * "location": { * "latitude": 32.141816, * "longitude": 34.7987383 * }, * "streetAddress": { * "name": "Yunitsman Street", * "number": "5", * "apt": "" * }, * "city": "Tel Aviv-Yafo", * "subdivision": "", * "country": "IL", * "postalCode": "" * }, * "businessSchedule": { * "periods": [ * { * "openDay": "SUNDAY", * "openTime": "00:00", * "closeDay": "MONDAY", * "closeTime": "00:00" * }, * { * "openDay": "THURSDAY", * "openTime": "00:00", * "closeDay": "SUNDAY", * "closeTime": "00:00" * } * ], * "specialHourPeriod": [] * }, * "_id": "9bd42376-12c2-483e-86c3-8ee685e718e1" * }, * "configuration": { * "onlineReservations": { * "partiesSize": { * "min": 1, * "max": 6 * }, * "minimumReservationNotice": { * "number": 15, * "unit": "MINUTES" * }, * "turnoverTimeRules": [], * "turnoverRules": [], * "onlineReservationsEnabled": true * }, * "myReservationsFields": [] * }, * "default": false, * "archived": false, * "_id": "800c581a-1942-4079-8198-2eee44463eb7" * }, * { * "location": { * "name": "Nemal Tel Aviv Street", * "fax": "", * "timeZone": "Europe/Dublin", * "email": "", * "phone": "", * "address": { * "formatted": "Tel Aviv Port, Nemal Tel Aviv Street, Tel Aviv, Israel", * "location": { * "latitude": 32.0972612, * "longitude": 34.77376549999999 * }, * "streetAddress": { * "name": "Nemal Tel Aviv Street", * "number": "", * "apt": "" * }, * "city": "Tel Aviv-Yafo", * "country": "IL" * }, * "businessSchedule": { * "periods": [ * { * "openDay": "SUNDAY", * "openTime": "00:00", * "closeDay": "MONDAY", * "closeTime": "00:00" * }, * { * "openDay": "THURSDAY", * "openTime": "00:00", * "closeDay": "SUNDAY", * "closeTime": "00:00" * } * ], * "specialHourPeriod": [] * }, * "_id": "f1f59093-6842-45a4-b9d1-106429ec8313" * }, * "configuration": { * "onlineReservations": { * "partiesSize": { * "min": 1, * "max": 6 * }, * "minimumReservationNotice": { * "number": 15, * "unit": "MINUTES" * }, * "turnoverTimeRules": [], * "turnoverRules": [], * "businessSchedule": { * "periods": [ * { * "openDay": "SUNDAY", * "openTime": "00:00", * "closeDay": "TUESDAY", * "closeTime": "00:00" * }, * { * "openDay": "WEDNESDAY", * "openTime": "00:00", * "closeDay": "THURSDAY", * "closeTime": "00:00" * }, * { * "openDay": "FRIDAY", * "openTime": "00:00", * "closeDay": "SUNDAY", * "closeTime": "00:00" * } * ], * "specialHourPeriod": [] * }, * "onlineReservationsEnabled": true * }, * "reservationForm": { * "customFieldDefinitions": [ * { * "name": "Allergies", * "required": false, * "_id": "f4283b2d-6340-4cf9-bae7-8769e6b62127" * } * ] * }, * "myReservationsFields": [] * }, * "default": true, * "archived": false, * "_id": "fab8cc1f-31cf-462f-b5bb-392594624bf2" * } * ], * "_originQuery": { * "filterTree": { * "$and": [] * }, * "invalidArguments": [], * "encoder": {}, * "transformationPaths": {}, * "sort": [], * "paging": {}, * "pagingMethod": "CURSOR", * "builderOptions": { * "cursorWithEmptyFilterAndSort": true * } * }, * "_limit": 50, * "_nextCursor": "", * "_prevCursor": "", * "cursors": { * "next": "", * "prev": "" * } * } */ ``` ## Query all reservation locations with options (backend) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { reservationLocations } from 'wix-table-reservations.v2'; import { elevate } from 'wix-auth'; /* Sample options value: * { * "fieldsets": ["FULL"] * } */ export const myQueryReservationLocationsFunction = webMethod(Permissions.Anyone, async (options) => { const elevatedQueryReservationLocations = elevate(reservationLocations.QueryReservationLocations); try { const retrievedReservationLocations = await elevatedQueryReservationLocations(options).find(); const nextCursor = retrievedReservationLocations._nextCursor; const minNotice = retrievedReservationLocations._items[0].configuration.onlineReservations.minimumReservationNotice; return retrievedReservationLocations; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to: * { * "_items": [ * { * "revision": "30", * "location": { * "name": "Yunitsman Street", * "fax": "", * "timeZone": "Europe/Dublin", * "email": "", * "phone": "", * "address": { * "formatted": "Yunitsman Street 5, Tel Aviv-Yafo, Israel", * "location": { * "latitude": 32.141816, * "longitude": 34.7987383 * }, * "streetAddress": { * "name": "Yunitsman Street", * "number": "5", * "apt": "" * }, * "city": "Tel Aviv-Yafo", * "subdivision": "", * "country": "IL", * "postalCode": "" * }, * "businessSchedule": { * "periods": [ * { * "openDay": "SUNDAY", * "openTime": "00:00", * "closeDay": "MONDAY", * "closeTime": "00:00" * }, * { * "openDay": "THURSDAY", * "openTime": "00:00", * "closeDay": "SUNDAY", * "closeTime": "00:00" * } * ], * "specialHourPeriod": [] * }, * "_id": "9bd42376-12c2-483e-86c3-8ee685e718e1" * }, * "configuration": { * "onlineReservations": { * "partiesSize": { * "min": 1, * "max": 6 * }, * "partySize": { * "min": 1, * "max": 6 * }, * "minimumReservationNotice": { * "number": 20, * "unit": "MINUTES" * }, * "defaultTurnoverTime": 90, * "turnoverTimeRules": [], * "turnoverRules": [], * "onlineReservationsEnabled": true * }, * "reservationForm": { * "customFieldDefinitions": [] * }, * "myReservationsFields": [ * { * "fieldType": "TABLE", * "shown": true * }, * { * "fieldType": "START_DATE", * "shown": true * }, * { * "fieldType": "END_DATE", * "shown": true * }, * { * "fieldType": "CREATED_DATE", * "shown": true * }, * { * "fieldType": "UPDATED_DATE", * "shown": true * }, * { * "fieldType": "PARTY_SIZE", * "shown": true * }, * { * "fieldType": "FIRST_NAME", * "shown": true * }, * { * "fieldType": "LAST_NAME", * "shown": true * }, * { * "fieldType": "EMAIL", * "shown": true * }, * { * "fieldType": "PHONE", * "shown": true * }, * { * "fieldType": "ADDITIONAL_INFO", * "shown": true * }, * { * "fieldType": "TEAM_MESSAGE", * "shown": true * }, * { * "fieldType": "STATUS", * "shown": true * } * ], * "tableManagement": { * "tableDefinitions": [ * { * "name": "Small table", * "seatsMin": 1, * "seatsMax": 4, * "isActive": true, * "_id": "ec4adfb0-568f-4846-8f92-86059ef94ec8" * }, * { * "name": "Big table", * "seatsMin": 3, * "seatsMax": 6, * "isActive": true, * "_id": "63b73378-5e79-401c-9a69-3e4da76558d3" * } * ], * "deletedTableDefinitions": [], * "tableCombinations": [] * } * }, * "default": false, * "archived": false, * "_id": "800c581a-1942-4079-8198-2eee44463eb7", * "_createdDate": "2023-10-08T07:07:39.123Z", * "_updatedDate": "2024-01-17T12:56:25.112Z" * }, * { * "revision": "39", * "location": { * "name": "Nemal Tel Aviv Street", * "fax": "", * "timeZone": "Europe/Dublin", * "email": "", * "phone": "", * "address": { * "formatted": "Tel Aviv Port, Nemal Tel Aviv Street, Tel Aviv, Israel", * "location": { * "latitude": 32.0972612, * "longitude": 34.77376549999999 * }, * "streetAddress": { * "name": "Nemal Tel Aviv Street", * "number": "", * "apt": "" * }, * "city": "Tel Aviv-Yafo", * "country": "IL" * }, * "businessSchedule": { * "periods": [ * { * "openDay": "SUNDAY", * "openTime": "00:00", * "closeDay": "MONDAY", * "closeTime": "00:00" * }, * { * "openDay": "THURSDAY", * "openTime": "00:00", * "closeDay": "SUNDAY", * "closeTime": "00:00" * } * ], * "specialHourPeriod": [] * }, * "_id": "f1f59093-6842-45a4-b9d1-106429ec8313" * }, * "configuration": { * "onlineReservations": { * "seatPacing": { * "number": 11, * "enabled": false * }, * "partyPacing": { * "number": 6, * "enabled": true * }, * "partiesSize": { * "min": 1, * "max": 6 * }, * "partySize": { * "min": 1, * "max": 6 * }, * "minimumReservationNotice": { * "number": 20, * "unit": "MINUTES" * }, * "defaultTurnoverTime": 90, * "turnoverTimeRules": [], * "turnoverRules": [], * "businessSchedule": { * "periods": [ * { * "openDay": "SUNDAY", * "openTime": "00:00", * "closeDay": "TUESDAY", * "closeTime": "00:00" * }, * { * "openDay": "WEDNESDAY", * "openTime": "00:00", * "closeDay": "THURSDAY", * "closeTime": "00:00" * }, * { * "openDay": "FRIDAY", * "openTime": "00:00", * "closeDay": "SUNDAY", * "closeTime": "00:00" * } * ], * "specialHourPeriod": [] * }, * "onlineReservationsEnabled": true * }, * "reservationForm": { * "customFieldDefinitions": [ * { * "name": "Allergies", * "required": false, * "_id": "f4283b2d-6340-4cf9-bae7-8769e6b62127" * } * ] * }, * "myReservationsFields": [ * { * "fieldType": "TABLE", * "shown": true * }, * { * "fieldType": "START_DATE", * "shown": true * }, * { * "fieldType": "END_DATE", * "shown": true * }, * { * "fieldType": "CREATED_DATE", * "shown": true * }, * { * "fieldType": "UPDATED_DATE", * "shown": true * }, * { * "fieldType": "PARTY_SIZE", * "shown": true * }, * { * "fieldType": "FIRST_NAME", * "shown": true * }, * { * "fieldType": "LAST_NAME", * "shown": true * }, * { * "fieldType": "EMAIL", * "shown": true * }, * { * "fieldType": "PHONE", * "shown": true * }, * { * "fieldType": "ADDITIONAL_INFO", * "shown": true * }, * { * "fieldType": "TEAM_MESSAGE", * "shown": true * }, * { * "fieldType": "STATUS", * "shown": true * }, * { * "fieldType": "CUSTOM_FIELD", * "customFieldId": "f4283b2d-6340-4cf9-bae7-8769e6b62127", * "shown": false * } * ], * "tableManagement": { * "tableDefinitions": [ * { * "name": "Small table", * "seatsMin": 1, * "seatsMax": 4, * "isActive": true, * "_id": "1ed802ae-708f-4da6-9177-54c3df5d3dd5" * }, * { * "name": "Big table", * "seatsMin": 3, * "seatsMax": 6, * "isActive": true, * "_id": "2c8aed3a-20c5-404c-b075-84a92f90a996" * } * ], * "deletedTableDefinitions": [], * "tableCombinations": [ * { * "tableIds": [ * "1ed802ae-708f-4da6-9177-54c3df5d3dd5", * "2c8aed3a-20c5-404c-b075-84a92f90a996" * ], * "seatsMin": 7, * "seatsMax": 10, * "isActive": true, * "_id": "6df9a875-d30d-4c0f-9faa-0a5ae18cd6f6" * } * ] * } * }, * "default": true, * "archived": false, * "_id": "fab8cc1f-31cf-462f-b5bb-392594624bf2", * "_createdDate": "2023-07-10T09:06:07.507Z", * "_updatedDate": "2024-01-17T12:56:26.047Z" * } * ], * "_originQuery": { * "filterTree": { * "$and": [] * }, * "invalidArguments": [], * "encoder": {}, * "transformationPaths": {}, * "sort": [], * "paging": {}, * "pagingMethod": "CURSOR", * "builderOptions": { * "cursorWithEmptyFilterAndSort": true * } * }, * "_limit": 50, * "_nextCursor": "", * "_prevCursor": "", * "cursors": { * "next": "", * "prev": "" * } * } */ ``` ---