Inserts a reference in the specified property.
The insertReference()
function returns a Promise that resolves when a
reference to the referenced item(s) is added to the referring item in the
specified property. The Promise is rejected if the current user does not
have update permissions for the collection.
Calling the insertReference()
function does not trigger any hooks.
Notes:
insertReference()
function only applies to multi-reference fields.insertReference()
function is not supported for Single Item Collections.
The ID of the collection that contains the referring item.
To find your collectionId
, select the Databases tab in the Velo Sidebar.
Hover over your collection, click the three dots, and select Edit Settings.
The property to insert the reference into.
The referring item or referring item's ID.
The referenced item, referenced item's ID, an array of referenced items, or an array of referenced item IDs.
An object containing options to use when processing this operation.