> 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: get(collectionId: string, itemId: string, options: WixDataOptions) # Method package: wixData # Method menu location: wixData --> get # Method Link: https://dev.wix.com/docs/velo/apis/wix-data/get.md # Method Description: Retrieves an item from a collection. The `get()` function returns a Promise that resolves to the item with ID `itemId` from the specified collection, or null if the `itemId` is not found. The Promise is rejected if the current user does not have read permissions for the collection. If the specified collection contains reference fields, the ID of the referenced item is returned. To return the values of the referenced items use [`query()`](https://dev.wix.com/docs/velo/api-reference/wix-data/query.md) and [`include()`](https://dev.wix.com/docs/velo/api-reference/wix-data/wix-data-query/include.md). If the `get()` function is passed the ID of a hidden item, it returns `null`. Calling the `get()` function triggers the [`beforeGet()`](https://dev.wix.com/docs/velo/api-reference/wix-data/hooks/before-get.md) and [`afterGet()`](https://dev.wix.com/docs/velo/api-reference/wix-data/hooks/after-get.md) hooks if they have been defined. Use the `options` parameter to run `get()` from backend code without checking for permissions or without its registered hooks. > **Notes:** > - When using the `query()` or `get()` functions or another data retrieval method following a change to your database collection, the data retrieved may not contain your most recent changes. See [Wix Data and Eventual Consistency](https://dev.wix.com/docs/velo/api-reference/wix-data/introduction.md#api-reference_wix-data_wix-data-and-eventual-consistency) for more information. To solve this problem, you can use the [`setTimeout()`](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Timeouts_and_intervals#setTimeout) function to delay retrieving data following any changes to your database collection. > - To speed up data retrieval, the results of certain data queries are cached. Learn more about [caching data query results](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/data-api/about-caching-data-query-results.md). > - When using the `query()` or `get()` functions or another data retrieval method following a change to your database collection, the data retrieved may not contain your most recent changes. See [WiX Data and Eventual Consistency](https://dev.wix.com/docs/velo/api-reference/wix-data-v2/eventual-consistency.md) for more information. To solve this problem, you can use the [`setTimeout()`](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Timeouts_and_intervals#setTimeout) function to delay retrieving data following any changes to your database collection. > - To speed up data retrieval, the results of certain data requests are cached. Learn more about [caching data query results](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/data-api/about-caching-data-query-results.md). > - An `itemId` is required to retrieve an item even from a single-item collection. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Get an item from a collection ```javascript import wixData from 'wix-data'; // ... wixData.get("myCollection", "00001") .then((item) => { console.log(item); //see item below }) .catch((err) => { console.log(err); }); /* item is: * * { * "_id": "00001", * "_owner": "ffdkj9c2-df8g-f9ke-lk98-4kjhfr89keedb", * "_createdDate": "2017-05-24T12:33:18.938Z", * "_updatedDate": "2017-05-24T12:33:18.938Z", * "title": "Mr.", * "first_name": "John", * "last_name": "Doe" * } */ ``` ## Get an item from a collection using data options ```javascript import wixData from 'wix-data'; // ... let options = { "suppressAuth": true, "suppressHooks": true }; wixData.get("myCollection", "00001", options) .then((item) => { console.log(item); //see item below }) .catch((err) => { console.log(err); }); /* item is: * * { * "_id": "00001", * "_owner": "ffdkj9c2-df8g-f9ke-lk98-4kjhfr89keedb", * "_createdDate": "2017-05-24T12:33:18.938Z", * "_updatedDate": "2017-05-24T12:33:18.938Z", * "title": "Mr.", * "first_name": "John", * "last_name": "Doe" * } */ ``` ---