diff --git a/wix-data/wix-data.service.json b/wix-data/wix-data.service.json index 4f5c831568..684c128372 100644 --- a/wix-data/wix-data.service.json +++ b/wix-data/wix-data.service.json @@ -8,19 +8,55 @@ "docs": { "summary": "The wix-data module contains functionality for working with data in collections.", "description": - [ "To use the data module, import `wixData` from the `wix-data` module:", + [ "The Data API allows you to interact programmatically with your site's [database collections](https://support.wix.com/en/article/content-manager-creating-a-collection). ", + " ", + " With the Data API, you can:", + "", + " + Manage the data in your site's collections.", + " + [Filter](https://www.wix.com/velo/reference/wix-data/wixdatafilter), [sort](https://www.wix.com/velo/reference/wix-data/wixdatasort), and [query](https://www.wix.com/velo/reference/wix-data/query) your data.", + " + Intercept interactions with your collections using [data hooks](https://www.wix.com/velo/reference/wix-data/hooks).", + " + Work programmatically with [reference fields](https://support.wix.com/en/article/about-reference-fields-in-database-collections).", + " + [Aggregate](https://www.wix.com/velo/reference/wix-data/aggregate) data from your collections.", + "", + " For more information, see [Working with the Data API](https://support.wix.com/en/article/velo-working-with-the-data-api) and [Overview of the Wix Data and Wix Dataset APIs](https://support.wix.com/en/article/velo-overview-of-the-wix-data-and-wix-dataset-apis).", + "", + " To use the data module, import `wixData` from the `wix-data` module:", "", " ``` javascript", " import wixData from 'wix-data';", " ```", "", - " The wix-data API can be used in your site’s front-end or backend code.", + " ## Before you begin", + " ", + " It's important to note the following points before starting to code:", "", - " The wix-data API includes functions for managing the data in your collections,", - " building queries on collections, and registering hooks.", + " + The Data API can be used in your site’s frontend or backend code.", + " + The maximum size of an item that you can save to a collection is 500 kb.", + " + When using data retrieval methods such as `query()` or `get()` following a change to your database collection, the data retrieved may not yet contain ", + " your most recent changes. See [Wix-data and Eventual Consistency](https://www.wix.com/velo/reference/wix-data/introduction#wix-data_introduction_wix-data-and-eventual-consistency) for more information.", + " + When querying [Wix App Collections](https://support.wix.com/en/article/content-manager-working-with-wix-app-collections), check which fields can be filtered in the relevant [collection field article](https://support.wix.com/en/search?term=velo%20collection%20fields).", + " + [Updating](wix-data/update) a collection item replaces the existing database item. If the existing item had properties with values and those properties are not included in the updated item, ", + " the values in those properties are lost.", + " + Aggregations can only be used on collections you created. They cannot be used on [Wix App Collections](https://support.wix.com/en/article/content-manager-working-with-wix-app-collections).", + " + Some functions don't apply to [Single Item Collections](https://support.wix.com/en/article/content-manager-about-collections-with-a-single-item).", + " + Depending on the [permissions](https://support.wix.com/en/article/collection-permissions-an-overview) defined for your database collection, ", + " your site visitors may not have the permissions required to run a specific function. A function called with insufficient permissions will fail. When necessary, you can override permission ", + " checks in backend code by using the `SuppressAuth` option.", + " + You can connect [external database collections](https://support.wix.com/en/article/velo-integrating-external-databases-with-your-wix-site) to your Wix site and use any of the Wix Data APIs to manage and retrieve data from those collections. ", "", - " For more information, see [Working with the Data API](https://support.wix.com/en/article/velo-working-with-the-data-api) and [Overview of the Wix Data and Wix Dataset APIs](https://support.wix.com/en/article/velo-overview-of-the-wix-data-and-wix-dataset-apis).", + " ", + " ## Terminology", + " ", + " + **Aggregate**: Perform calculations on collection data to retrieve meaningful summaries. ", + " + **Distinct**: Function that returns the distinct values that match a query, without duplicates.", + " + **Hooks**: Hooks run code before or after certain interactions with your site's collections, sometimes allowing you to interact with ", + " the data handled in the interaction. For example, you can use the [`beforeInsert()`](wix-data/hooks/beforeinsert) hook to capitalize text before it's inserted into a collection.", + " + **Query**: Retrieve information from a database.", + " + **Reference field**: Fields in a database collection that let you link one collection with other collections. ", + " Specifically, a reference field associates an item in one collection with an item in a different collection.", + " + **Truncate**: Removes all items from a collection.", "", + " ", " ### Data Types", "", " The Wix Data API works with a schemaless database behind the scenes. In theory,", @@ -95,7 +131,7 @@ { "type": "wix-data.WixDataAggregate", "doc": "An aggregate object." }, "locations": - [ { "lineno": 927, + [ { "lineno": 964, "filename": "data-api.js" } ], "docs": { "summary": "Creates an aggregation.", @@ -196,7 +232,7 @@ [ "wix-data.WixDataBulkResult" ] }, "doc": "Fulfilled - The results of the bulk insert.\nRejected - The error that caused the rejection." }, "locations": - [ { "lineno": 754, + [ { "lineno": 791, "filename": "data-api.js" } ], "docs": { "summary": "Adds a number of items to a collection.", @@ -463,7 +499,7 @@ [ "wix-data.WixDataBulkRemoveResult" ] }, "doc": "Fulfilled - The results of the bulk remove.\nRejected - The error that caused the rejection." }, "locations": - [ { "lineno": 381, + [ { "lineno": 418, "filename": "data-api.js" } ], "docs": { "summary": "Removes a number of items from a collection.", @@ -577,7 +613,7 @@ [ "wix-data.WixDataBulkResult" ] }, "doc": "Fulfilled - The results of the bulk save.\nRejected - The error that caused the rejection." }, "locations": - [ { "lineno": 812, + [ { "lineno": 849, "filename": "data-api.js" } ], "docs": { "summary": "Inserts or updates a number of items in a collection.", @@ -843,7 +879,7 @@ [ "wix-data.WixDataBulkResult" ] }, "doc": "Fulfilled - The results of the bulk save.\nRejected - The error that caused the rejection." }, "locations": - [ { "lineno": 869, + [ { "lineno": 906, "filename": "data-api.js" } ], "docs": { "summary": "Updates a number of items in a collection.", @@ -1044,7 +1080,7 @@ { "type": "wix-data.WixDataFilter", "doc": "A filter object." }, "locations": - [ { "lineno": 273, + [ { "lineno": 310, "filename": "data-api.js" } ], "docs": { "summary": "Creates a filter to be used with datasets and aggregations.", @@ -1092,7 +1128,7 @@ [ "Object" ] }, "doc": "Fulfilled - The retrieved item or null if not found.\nRejected - The error that caused the rejection." }, "locations": - [ { "lineno": 115, + [ { "lineno": 152, "filename": "data-api.js" } ], "docs": { "summary": "Retrieves an item from a collection.", @@ -1180,8 +1216,7 @@ "extra": { } }, { "name": "insert", - "labels": - [ "changed" ], + "labels": [], "nameParams": [], "params": [ { "name": "collectionId", @@ -1201,7 +1236,7 @@ [ "Object" ] }, "doc": "Fulfilled - The item that was added.\nRejected - The error that caused the rejection." }, "locations": - [ { "lineno": 150, + [ { "lineno": 187, "filename": "data-api.js" } ], "docs": { "summary": "Adds an item to a collection.", @@ -1470,7 +1505,7 @@ [ "void" ] }, "doc": "Fulfilled - When the references have been inserted.\nRejected - The error that caused the rejection." }, "locations": - [ { "lineno": 608, + [ { "lineno": 645, "filename": "data-api.js" } ], "docs": { "summary": "Inserts a reference in the specified property.", @@ -1554,7 +1589,7 @@ [ "boolean" ] }, "doc": "Fulfilled - Whether the referring item contains a reference to the referenced item or not.\nRejected - The error that caused the rejection." }, "locations": - [ { "lineno": 710, + [ { "lineno": 747, "filename": "data-api.js" } ], "docs": { "summary": "Checks if a reference to the referenced item exists in the specified\n property of the referring item.", @@ -1600,7 +1635,7 @@ { "type": "wix-data.WixDataQuery", "doc": "A query object." }, "locations": - [ { "lineno": 208, + [ { "lineno": 245, "filename": "data-api.js" } ], "docs": { "summary": "Creates a query for retrieving items from a database collection.", @@ -1853,7 +1888,7 @@ [ "wix-data.WixDataQueryReferencedResult" ] }, "doc": "Fulfilled - The referenced items.\nRejected - The error that caused the rejection." }, "locations": - [ { "lineno": 558, + [ { "lineno": 595, "filename": "data-api.js" } ], "docs": { "summary": "Gets the full items referenced in the specified property.", @@ -1979,7 +2014,7 @@ [ "Object" ] }, "doc": "Fulfilled - The removed item.\nRejected - The error that caused the rejection." }, "locations": - [ { "lineno": 301, + [ { "lineno": 338, "filename": "data-api.js" } ], "docs": { "summary": "Removes an item from a collection.", @@ -2107,7 +2142,7 @@ [ "void" ] }, "doc": "Fulfilled - When the references have been removed.\nRejected - The error that caused the rejection." }, "locations": - [ { "lineno": 677, + [ { "lineno": 714, "filename": "data-api.js" } ], "docs": { "summary": "Removes a reference from the specified property.", @@ -2195,7 +2230,7 @@ [ "void" ] }, "doc": "Fulfilled - When the references have been inserted.\nRejected - The error that caused the rejection." }, "locations": - [ { "lineno": 643, + [ { "lineno": 680, "filename": "data-api.js" } ], "docs": { "summary": "Replaces current references with references in the specified property.", @@ -2267,7 +2302,7 @@ [ "Object" ] }, "doc": "Fulfilled - The item that was either inserted or updated, depending on whether it previously existed in the collection.\nRejected - The error that caused the rejection." }, "locations": - [ { "lineno": 418, + [ { "lineno": 455, "filename": "data-api.js" } ], "docs": { "summary": "Inserts or updates an item in a collection.", @@ -2500,7 +2535,7 @@ { "type": "wix-data.WixDataSort", "doc": "A sort object." }, "locations": - [ { "lineno": 287, + [ { "lineno": 324, "filename": "data-api.js" } ], "docs": { "summary": "Creates a sort to be used with the dataset `setSort()` function.", @@ -2545,7 +2580,7 @@ [ "null" ] }, "doc": "Fulfilled - When the items have been removed.\nRejected - The error that caused the rejection." }, "locations": - [ { "lineno": 337, + [ { "lineno": 374, "filename": "data-api.js" } ], "docs": { "summary": "Removes all items from a collection.", @@ -2626,7 +2661,7 @@ [ "Object" ] }, "doc": "Fulfilled - The object that was updated.\nRejected - The error that caused the rejection." }, "locations": - [ { "lineno": 471, + [ { "lineno": 508, "filename": "data-api.js" } ], "docs": { "summary": "Updates an item in a collection.", @@ -2909,7 +2944,7 @@ "messages": [ { "name": "WixDataBulkRemoveResult", "locations": - [ { "lineno": 371, + [ { "lineno": 408, "filename": "data-api.js" } ], "docs": { "summary": "An object returned by the `bulkRemove()` function.", @@ -2941,7 +2976,7 @@ "labels": [] }, { "name": "WixDataBulkResult", "locations": - [ { "lineno": 742, + [ { "lineno": 779, "filename": "data-api.js" } ], "docs": { "summary": "An object returned by Wix Data bulk operations.", @@ -3053,7 +3088,7 @@ "labels": [] }, { "name": "WixDataQueryReferencedOptions", "locations": - [ { "lineno": 532, + [ { "lineno": 569, "filename": "data-api.js" } ], "docs": { "summary": "An object for controlling the order of returned referenced items.",