PersistentObject ["name",loc]
represents a persistent object stored at persistence location loc.
PersistentObject
PersistentObject ["name",loc]
represents a persistent object stored at persistence location loc.
Details
- PersistentObject["name",loc]["meta"]=val sets the metadata element "meta" to val.
- The following metadata elements can be given:
-
"Value" Null the value of the persistent object itself"MergingFunction" Automatic the default merging function to use"ValuePreprocessingFunction" Identity the function applied to new values to be assigned"ModificationDate" None time stamp of last modification"ExpirationDate" None time after which data is no longer used"Creator" $Username user 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:
-
"type" equivalent to PersistenceLocation ["type"]
- 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"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
Examples
open all close allBasic 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 (2)
Create a persistent object by assigning it a value:
Refer to a persistent object:
Give all of its properties:
Access its meta elements:
Modify its expiration date:
Access the persistent object's name and location:
Properties & Relations (3)
Persistent symbols 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 (1)
Applying PersistentObject itself does not create an actual object; it only refers to an object:
Accessing its properties will return an error:
Only by setting one of its meta elements is it actually created:
Delete a persistent object with DeleteObject :
Related Guides
Text
Wolfram Research (2017), PersistentObject, Wolfram Language function, https://reference.wolfram.com/language/ref/PersistentObject.html (updated 2020).
CMS
Wolfram Language. 2017. "PersistentObject." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/PersistentObject.html.
APA
Wolfram Language. (2017). PersistentObject. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PersistentObject.html
BibTeX
@misc{reference.wolfram_2025_persistentobject, author="Wolfram Research", title="{PersistentObject}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/PersistentObject.html}", note=[Accessed: 05-December-2025]}
BibLaTeX
@online{reference.wolfram_2025_persistentobject, organization={Wolfram Research}, title={PersistentObject}, year={2020}, url={https://reference.wolfram.com/language/ref/PersistentObject.html}, note=[Accessed: 05-December-2025]}