represents a persistent object stored at persistence location loc.


  • PersistentObject["name",loc]["meta"]=val sets the metadata element "meta" to val.
  • The following metadata elements can be given:
  • "Value"Nullthe value of the persistent object itself
    "HeldValue"Hold[Null]the value wrapped in Hold
    "MergingFunction"Automaticthe default merging function to use
    "ValuePreprocessingFunction"Identitythe function applied to new values to be assigned
    "ModificationDate"Nonetime stamp of last modification
    "ExpirationDate"Nonetime after which data is no longer used
    "Creator"$Usernameuser who last modified the object
  • PersistentObject["name",loc][All] gives the association of all metadata.
  • PersistentObject["name",loc]["Name"] gives "name", and PersistentObject["name",loc]["Location"] gives loc.
  • DeleteObject[PersistentObject[]] removes a persistent object from the specified location.
  • In PersistentObject["name",loc], possible forms for the persistence location loc include:
  • PersistenceLocation["type"]"Local", "Cloud", etc. locations
    "type"equivalent to PersistenceLocation["type"]
    PersistenceLocation["type","base"]location with a particular base (directory etc.)
    "type""base"equivalent to PersistenceLocation["type","base"]
  • Supported location types include:
  • "KernelSession"current invocation of the Wolfram Language kernel
    "FrontEndSession"current invocation of the Wolfram Notebook front end
    "Notebook"the notebook in which the current evaluation is being done
    "ServerSession"persistence for requests on a single web server
    "CookieManaged"persistence based on a Wolfram browser cookie
    "Local"local to a computer, based on user home directory
    "LocalShared"local to a computer, based on $BaseDirectory
    "Cloud"in the cloud defined by the current $CloudBase
    "Installation"installation defaults


open allclose all

Basic Examples  (2)

Create a persistent object by assigning it a value:

Give all metadata of the object:

Give a specific meta element:

Remove a persistent object:

Remove all persistent objects with a given key on $PersistencePath:

Scope  (1)

Refer to a persistent object:

Create it by setting its value:

Access its meta elements:

Modify its expiration date:

Access its parts:

Properties & Relations  (3)

Persistent values are stored in persistent objects:

Individual date-related meta elements are returned as date objects:

Give a list of all persistent objects existing at a particular location:

Possible Issues  (2)

Applying PersistentObject itself does not create an actual object; it only refers to an object. So accessing its elements will return an error:

Only by setting one of its meta elements is it actually created:

Delete a persistent object with DeleteObject:

Direct assignment to the components of a persistent object is not possible:

Use a variable to hold the object and modify the components of the variable instead:

Wolfram Research (2017), PersistentObject, Wolfram Language function, (updated 2020).


Wolfram Research (2017), PersistentObject, Wolfram Language function, (updated 2020).


@misc{reference.wolfram_2021_persistentobject, author="Wolfram Research", title="{PersistentObject}", year="2020", howpublished="\url{}", note=[Accessed: 26-September-2021 ]}


@online{reference.wolfram_2021_persistentobject, organization={Wolfram Research}, title={PersistentObject}, year={2020}, url={}, note=[Accessed: 26-September-2021 ]}


Wolfram Language. 2017. "PersistentObject." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020.


Wolfram Language. (2017). PersistentObject. Wolfram Language & System Documentation Center. Retrieved from