The parameters for renaming the document. This includes:
doctype: The document type of the document to be renamed.old_name: The current name of the document to be renamed.new_name: The new name for the document.merge (optional): A boolean indicating whether to merge the old document into the new one if the new name already exists. Defaults to false.A promise that resolves to true if the document was successfully renamed, or false if the operation failed.
Renames an existing document in the database.
This function performs an asynchronous request to the server to rename a document of the specified type. It updates the document's name from the
old_nameto thenew_name. Optionally, ifmergeis set totrue, the function will merge the old document into the new document if it exists, preserving related data.Example
Example
Example
Throws
Throws an error if the request fails or if there is an issue with the renaming operation.