### Enable Singleton Repository Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VORepository.class/README.md Enables the repository to be used as a singleton instance. This is the standard way to install a repository in image mode. ```Smalltalk aRepository enableSingleton. ``` -------------------------------- ### Install Voyage with MongoDB Backend Source: https://github.com/pharo-nosql/voyage/blob/master/README.md Installs the Voyage library with the MongoDB backend and its associated tests using Metacello. This command fetches the necessary packages from the specified GitHub repository. ```Smalltalk Metacello new repository: 'github://pharo-nosql/voyage/mc'; baseline: 'Voyage'; load: 'mongo tests'. ``` -------------------------------- ### Install Voyage with UnQLite Backend (Deprecated) Source: https://github.com/pharo-nosql/voyage/blob/master/README.md Installs the Voyage library with the UnQLite backend and its associated tests using Metacello. Note that this backend is deprecated and no longer maintained. ```Smalltalk Metacello new repository: 'github://pharo-nosql/voyage/mc'; baseline: 'Voyage'; load: 'unqlite tests'. ``` -------------------------------- ### Install Voyage with EJDB Backend Source: https://github.com/pharo-nosql/voyage/blob/master/README.md Installs the Voyage library with the EJDB backend and its associated tests using Metacello. This command fetches the necessary packages from the specified GitHub repository. ```Smalltalk Metacello new repository: 'github://pharo-nosql/voyage/mc'; baseline: 'Voyage'; load: 'ejdb tests'. ``` -------------------------------- ### Install Voyage with ArangoDB Backend (Preview/Deprecated) Source: https://github.com/pharo-nosql/voyage/blob/master/README.md Installs the Voyage library with the ArangoDB backend and its associated tests using Metacello. This backend is in preview and has been deprecated. ```Smalltalk Metacello new repository: 'github://pharo-nosql/voyage/mc'; baseline: 'Voyage'; load: 'arango tests'. ``` -------------------------------- ### Using VOCurrentRepository within a Seaside Filter Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VODynamicContainer.class/README.md This example demonstrates how to use VOCurrentRepository within a Seaside handler to obtain a session repository and execute a block of code during its context. It highlights accessing repository functionality within a web request context. ```Smalltalk handleFiltered: aRequestContext VOCurrentRepository value: self obtainSessionRepository during: [ self next handleFiltered: aRequestContext]. ``` -------------------------------- ### Get Collection Count in ArangoDB Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Arango-Core.package/VOArangoCountOperation.class/README.md This snippet demonstrates how to get the number of documents in an ArangoDB collection using the Voyage Pharo Smalltalk library. It assumes a connection to the ArangoDB server has already been established. ```Pharo Smalltalk voyage := VoyageArangoDB new. voyage connectTo: 'http://localhost:8529' database: 'myDatabase' user: 'root' password: 'password'. collectionName := 'myCollection'. count := voyage countDocumentsInCollection: collectionName. Transcript show: 'Number of documents in ', collectionName, ': ', count printString; cr. ``` -------------------------------- ### Instantiate and Enable Singleton for File-Based UnQLite Repository Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-UnQLite.package/VOUnQLiteRepository.class/README.md This snippet demonstrates how to create a Voyage UnQLite repository instance that persists data to a specified file path and enables it as a singleton. ```Smalltalk (VOUnQLiteRepository on: 'path/to/database.db') enableSingleton. ``` -------------------------------- ### Initialize Voyage MongoDB Repository Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Mongo-Core.package/VOMongoRepository.class/README.md Demonstrates the basic initialization of the VOMongoRepository for connecting to a MongoDB instance. Requires specifying the host and database name. ```Smalltalk VOMongoRepository host: 'yourhost' database: 'yourdatabase' ``` -------------------------------- ### Set Repository Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VORepository.class/README.md Sets the global repository instance. This should be called after enabling the singleton. ```Smalltalk VORepository setRepository: aRepository. ``` -------------------------------- ### Instantiate and Enable Singleton for In-Memory UnQLite Repository Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-UnQLite.package/VOUnQLiteRepository.class/README.md This snippet shows how to create a Voyage UnQLite repository instance that uses an in-memory database and enables it as a singleton, typically used for testing purposes. ```Smalltalk VOUnQLiteRepository onMemory enableSingleton. ``` -------------------------------- ### Set Repository Container Strategy Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VORepository.class/README.md Allows changing the container strategy for the repository, providing flexibility beyond the default singleton pattern. ```Smalltalk VORepository setRepositoryContainer: aRepositoryContainer. ``` -------------------------------- ### Common Test Behaviors in Pharo Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Mongo-MultipleImageTests.package/VOTMultipleImageTest.trait/README.md Provides a set of common behaviors and utilities for writing tests that are compatible with multiple Pharo image versions. This helps in maintaining consistent test suites for NoSQL integrations. ```Pharo Object subclass: #VoyageCommonTestBehavior instanceVariableNames: '' classVariableNames: '' package: 'Voyage-Tests-Core'. VoyageCommonTestBehavior >> setUp "Common setup for tests" super setUp. "Add common initialization logic here". VoyageCommonTestBehavior >> tearDown "Common teardown for tests" super tearDown. "Add common cleanup logic here". ``` -------------------------------- ### Configure VORepository with VODynamicContainer Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VODynamicContainer.class/README.md This snippet shows the required configuration to set up VODynamicContainer as the repositoryContainer for VORepository, enabling the dynamic container functionality. ```Smalltalk VORepository repositoryContainer: VODynamicContainer new. ``` -------------------------------- ### Thread-Local Repository Handling with VODynamicContainer Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VOCurrentRepository.class/README.md Demonstrates how to manage thread-local repository requests using VOCurrentRepository within a Seaside filter. This pattern ensures that the correct repository instance is available for the current thread's operations. ```Smalltalk handleFiltered: aRequestContext VOCurrentRepository value: self obtainSessionRepository during: [ self next handleFiltered: aRequestContext]. ``` -------------------------------- ### Voyage Memory Repository Structure Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Memory-Core.package/VOMemoryRepository.class/README.md Details the internal structure of the Voyage memory repository, specifically its use of a Dictionary to map objects. ```Pharo Smalltalk objectMap - a map of objects ``` -------------------------------- ### Sort Expression Construction Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VOOrder.class/README.md Demonstrates how to construct a sort expression using a dictionary to specify attribute names and their corresponding order (ascending or descending). This is a common pattern for defining query sorting criteria. ```Smalltalk APersistentClass selectAllSortBy: { 'name' -> VOOrder ascending } asDictionary. ``` -------------------------------- ### Voyage Version Generation Components Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VOTimestampVersionGenerator.class/README.md Details the components used to construct a version identifier in the Voyage project. This includes a machine identifier, a millisecond timestamp, and a counter. ```text A 2-byte machine identifier (random generated), A 4-byte value representing the milliseconds, A 2-byte counter. ``` -------------------------------- ### JSON to Smalltalk Object Materialization Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-JSON.package/VOJSONMaterializer.class/README.md Demonstrates the core functionality of materializing JSON documents into Smalltalk objects. This process involves parsing JSON data and mapping it to corresponding object structures within the Pharo environment. ```Smalltalk JSONLoader new loadFromUrl: 'http://example.com/data.json' into: MyObject ``` -------------------------------- ### Voyage Database Read Operations Base Class Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VOReadManyOperation.class/README.md This class provides the foundation for database operations that retrieve collections of objects. It manages parameters for pagination (offset and limit) and sorting (sortBlock) to control the data retrieval process. ```Smalltalk Object subclass: #VoyageDatabaseReadOperation instanceVariableNames: 'offset limit sortBlock' classVariableNames: '' package: 'Voyage-Core' !VoyageDatabaseReadOperation methodsFor: 'initialization'! initialize "Initialize the operation with default values." offset := 0. limit := -1. "-1 indicates no limit" sortBlock := nil. ! !VoyageDatabaseReadOperation methodsFor: 'accessing'! setOffset: anInteger "Set the offset for the query." offset := anInteger. ! setLimit: anInteger "Set the limit for the query." limit := anInteger. ! setSortBlock: aBlock "Set the block used for sorting the results." sortBlock := aBlock. ! getOffset "Return the current offset." ^ offset ! getLimit "Return the current limit." ^ limit ! getSortBlock "Return the current sort block." ^ sortBlock ! ``` -------------------------------- ### Voyage Base Repository Class Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VOExternalRepository.class/README.md This class serves as the foundation for external object repositories. It manages a version generator for tracking external object states and a cache for re-establishing object identity when reading external representations back into the image. It also provides basic database operations via VOOperation subclasses. ```Smalltalk ObjectRepository "A base class for object repositories that are external to the image. I hold a version generator to version the current state of the object in the outside world. I hold a cache to establish identity when reading external representations back into the image. I also consist of the basic actions of a database that are supported in voyage. For all this operations a VOOperation subclass is instantiated." versionGenerator "Returns the version generator." cache "Returns the cache." basicActions "Returns the basic database actions." ``` -------------------------------- ### Voyage Persistence Marker Behavior Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-JSON.package/VOJSONFuture.class/README.md Explains the purpose of the persistence marker, its use in preventing cyclic references, and how its equality and hash codes are handled after persistence. ```Pharo Smalltalk I'm a marker for an object who is persistent and "about to be persisted". This is used to prevent cyclic references. See VOJSONSerializer>>#ensurePersisted: for datails of its use. To be sure everything works (like fnding the future in cache, etc.), I make sure some hacks happen: ==equals== and ==hash== are equivallent once the become happened. Of course, this is not recommendable as a general practice, but it works here :) ``` -------------------------------- ### MongoDB Single Object Read by Query Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Mongo-Core.package/VOMongoReadOneOperation.class/README.md Demonstrates the MongoDB-specific method for reading a single object from the database using a query. ```Pharo MongoDBCollection>>atQuery: "Reads a single object from the database by query." "Example: myCollection atQuery: (Query where: #name equals: 'John')" ``` -------------------------------- ### Voyage Session Pool Instance Variables Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VOSessionPool.class/README.md Details the instance variables of the session pool, which manage concurrency, processes, active sessions, and pool size. ```Smalltalk mutex - xxxxx process - xxxxx sessions - xxxxx size - xxxxx ``` -------------------------------- ### Object and Reference Traversal in Voyage Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VOCollector.class/README.md Demonstrates how to traverse an object and its referenced objects (VODescription references) within the Voyage project. This functionality is key for selectively collecting data for NoSQL operations. ```Pharo Object>>traverseAndCollect: "Traverses the receiver and its referenced objects, collecting them selectively." | collector | collector := VODescription collector. self traverseWith: collector. ^ collector collectedObjects ``` -------------------------------- ### WeakKeyAssociation and VOWeakKeyDictionary Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VOWeakKeyAssociation.class/README.md Explains the role of WeakKeyAssociation within a VOWeakKeyDictionary. When an association is mourned (garbage collected), it triggers the removal of its counterpart from the dictionary, ensuring data consistency. ```Smalltalk Object subclass: #VOWeakKeyAssociation instanceVariableNames: 'key value reversed' classVariableNames: '' poolDictionaries: '' category: 'Voyage-Core-Associations'! VOWeakKeyAssociation >> key ^key! VOWeakKeyAssociation >> value ^value! VOWeakKeyAssociation >> reversed ^reversed! VOWeakKeyAssociation >> reversed: anAssociation reversed := anAssociation! VOWeakKeyAssociation >> beMourned "When this association is mourned, remove its reversed counterpart." reversed ifNotNil: [ reversed dictionary removeKey: reversed key ]. super beMourned! Dictionary subclass: #VOWeakKeyDictionary instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Voyage-Core-Dictionaries'! VOWeakKeyDictionary >> at: key put: value "Create a weak association for the key and a strong association for the value." | forwardAssociation backwardAssociation | forwardAssociation := VOWeakKeyAssociation new. forwardAssociation key: key. forwardAssociation value: value. backwardAssociation := VOWeakKeyAssociation new. backwardAssociation key: value. backwardAssociation value: key. forwardAssociation reversed: backwardAssociation. backwardAssociation reversed: forwardAssociation. super at: key put: forwardAssociation. self at: value put: backwardAssociation. ^value! VOWeakKeyDictionary >> removeKey: key "Remove the key and its associated weak counterpart." | association | association := self at: key ifAbsent: [ ^self ]. self removeItem: association. self removeKey: association reversed key. ^self! VOWeakKeyDictionary >> removeItem: anAssociation "Remove an association from the dictionary." super removeKey: anAssociation key! ``` -------------------------------- ### Object to Dictionary Serialization Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-JSON.package/VOJSONSerializer.class/README.md This snippet demonstrates the core functionality of Voyage, serializing Pharo objects into generic dictionary representations. It handles the conversion from Smalltalk objects to a format compatible with JSON. ```Pharo Smalltalk serializer := VoyageSerializer new. object := YourPharoObject new. serializedObject := serializer serialize: object. "serializedObject is now a dictionary representing the Pharo object." ``` -------------------------------- ### Weak Key Dictionary for VOCache Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VOWeakKeyDictionary.class/README.md Implements a weak key dictionary designed for VOCache. It maintains synchronization between object and reversed object dictionaries, ensuring that when an association is removed, its reversed counterpart is also removed to prevent data inconsistency. ```Pharo Smalltalk Object subclass: #VOCache instanceVariableNames: 'objects reversedObjects' classVariableNames: '' poolDictionaries: '' "... other methods ..." removeKey: aKey "Remove the key and its reversed equivalent." | reversedKey | reversedKey := reversedObjects at: aKey ifAbsent: [ nil ]. objects removeKey: aKey ifAbsent: []. reversedKey ifNotNil: [ reversedObjects removeKey: reversedKey ifAbsent: [] ]. ``` -------------------------------- ### VOMongoIDMirrorDescription API Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Mongo-Core.package/VOMongoIDMirrorDescription.class/README.md API documentation for the VOMongoIDMirrorDescription class, which is used to configure the mirroring of MongoDB's '_id' field to a specified attribute name in Pharo objects. ```APIDOC VOMongoIDMirrorDescription: attributeName: attributeName attributeName: The name of the Pharo instance variable to which the MongoDB '_id' will be mirrored. yourself Returns the configured VOMongoIDMirrorDescription instance. ``` -------------------------------- ### MongoDB Object Insertion Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Mongo-Core.package/VOMongoInsertOperation.class/README.md Demonstrates how to insert an object into a MongoDB database using the Voyage library. This method is specific to MongoDB's insertion mechanism. ```Pharo voyage insert: anObject into: aCollectionName ``` -------------------------------- ### Object Insertion in Voyage Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VOInsertOperation.class/README.md Demonstrates the operation for inserting new objects into a NoSQL database using the Voyage framework. This is a fundamental operation for adding data. ```Pharo voyage insert: newObject "Inserts a new object into the database." ``` -------------------------------- ### MongoDB Association Persistence in Pharo Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Mongo-Utils.package/VOMongoKeyPair.class/README.md This snippet illustrates how Voyage handles the persistence of Pharo associations in MongoDB. It highlights the expected format for associations in MongoDB, which is an array of [string, value] pairs. ```Pharo Object subclass: #MyPersistentObject instanceVariableNames: 'name value associationList' package: 'MyPackage'. MyPersistentObject >> initialize super initialize. associationList := OrderedCollection new. MyPersistentObject >> addAssociation: aSymbol with: aValue associationList add: (Array with: aSymbol asString with: aValue). MyPersistentObject >> persist "Assuming 'voyage' is a configured MongoDB connection" voyage at: 'myCollection' add: self. "Example Usage: myObject := MyPersistentObject new. myObject addAssociation: #key1 with: 'value1'. myObject addAssociation: #key2 with: 123. myObject persist. ``` -------------------------------- ### Execute MongoDB Repository Operation with Retries Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Mongo-Core.package/VOMongoExecuteStrategy.class/README.md Demonstrates the execution of a MongoDB repository operation with automatic retries on error. This is useful for handling transient network issues or temporary database unavailability. ```Pharo repository execute: aBlock onConnectionError: retryBlock "Execute the block, retrying on connection errors." [ self retry: 3 delay: 1000 block: [ aBlock value ] ] on: ConnectionError do: [ :ex | retryBlock value: ex ]. ``` -------------------------------- ### MongoDB Persistence for Collections Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Mongo-Utils.package/VOMongoKeyPairManyValues.class/README.md This snippet illustrates the core concept of Voyage, where arbitrary elements within collections are persisted to MongoDB. It highlights the library's capability to manage complex data structures. ```Pharo MongoCollection "Persists collections of arbitrary elements to MongoDB." add: anObject "Adds anObject to the collection and persists it." remove: anObject "Removes anObject from the collection and persists the change." all "Retrieves all elements from the collection." ``` -------------------------------- ### MongoDB Collection Container Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-JSON.package/VOContainer.class/README.md Represents a container for a MongoDB collection within the Voyage library. It holds attribute descriptions for the collection. ```Smalltalk MongoCollection "A container for a mongo collection (I contain attribute descriptions)" attributes "Returns the attribute descriptions for this collection." ^ attributes ``` -------------------------------- ### MongoDB Class Reference Container Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-JSON.package/VOReferenceContainer.class/README.md Defines a special container for Pharo classes that stores references in MongoDB. The references are serialized as a dictionary with the key '#referenceOf' pointing to the class name. This is intended to be used as a definition for a container of classes. ```Smalltalk mongoContainer ^VOMongoReferenceContainer new ``` -------------------------------- ### Count MongoDB Documents Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Mongo-Core.package/VOMongoCountOperation.class/README.md This snippet demonstrates how to count the number of documents in a MongoDB collection that match a given query. It utilizes the Voyage library's specific methods for efficient counting. ```Pharo collection count: query ``` -------------------------------- ### ArangoDB Object Insertion Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Arango-Core.package/VOArangoInsertOperation.class/README.md This snippet demonstrates how to insert an object into an ArangoDB collection using the Voyage project's implementation. It handles the specifics of connecting to ArangoDB and performing the insert operation. ```Pharo voyageArangoDB insertObject: anObject intoCollection: aCollectionName "Inserts anObject into the ArangoDB collection named aCollectionName." | collection | collection := self collectionNamed: aCollectionName. ^ collection insert: anObject ``` -------------------------------- ### ArangoDB Object Selection Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Arango-Core.package/VOArangoSelectManyOperation.class/README.md Implements the selection of a list of objects from an ArangoDB collection. This is specific to the ArangoDB backend for the Voyage project. ```Pharo Smalltalk Object selectFromCollection: collectionName "Selects a list of objects from the specified ArangoDB collection." | query | query := 'FOR doc IN ', collectionName, ' RETURN doc'. ^ self executeQuery: query ``` -------------------------------- ### Remove MongoDB Database Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Mongo-Core.package/VOMongoRemoveDatabaseOperation.class/README.md This snippet demonstrates how to remove a MongoDB database using the Voyage driver in Pharo. It requires an active connection to the MongoDB server. ```Pharo Smalltalk MongoDatabase removeDatabaseNamed: 'myDatabaseName'. ``` -------------------------------- ### MongoDB ID Mirroring Description Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Mongo-Core.package/VOMongoIDMirrorDescription.class/README.md Defines how to mirror the MongoDB '_id' field from a JSON document into a Pharo instance variable. This is useful for maintaining consistency between the database and object representations. ```Pharo mongoAttributeID ^ VOMongoIDMirrorDescription new attributeName: #'id'; yourself ``` -------------------------------- ### Object Update in Voyage Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VOInsertOperation.class/README.md Illustrates how to save an existing object, effectively updating its record in the NoSQL database. This operation is used for modifying previously stored data. ```Pharo voyage update: existingObject "Updates an existing object in the database." ``` -------------------------------- ### Remove Single Object from NoSQL Database Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VORemoveObjectOperation.class/README.md This snippet demonstrates a generic operation for removing a single object from a NoSQL database. It is designed to be abstract and adaptable to various NoSQL backends supported by the Voyage project. ```Pharo Object remove "Generic operation for removing a single object from the database." "This method should be implemented by specific NoSQL database adapters." ``` -------------------------------- ### Insert New Object Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VOUpdateOperation.class/README.md This operation is used for adding new objects to the database. It is employed when an object does not yet exist in the database. -------------------------------- ### Save Operation Representation Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VOSaveOperation.class/README.md Represents a save operation to a database, abstracting insert and update logic into subclasses. It holds the object to be saved and its external identifier. ```Pharo Smalltalk Object subclass: #VoyageSaveOperation instanceVariableNames: 'objectToSave objectId' "..." ``` -------------------------------- ### Delayed Value Resolution in Voyage Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-UnQLite.package/VOUnQLiteFutureID.class/README.md This snippet illustrates the core concept of Voyage's future ID, which delays the resolution of its value until the moment of persistence. This is crucial for correctly handling object references within a repository, such as a one-to-many relationship (A -> B). ```Pharo Object subclass: #FutureID instanceVariableNames: 'valueHolder' classVariableNames: '' package: 'Voyage-Core'. FutureID>>initialize super initialize. valueHolder := nil. FutureID>>value: "Sets the value to be resolved later." valueHolder := aValue. FutureID>>resolveValue "Resolves the value when needed, e.g., during persistence." ^ valueHolder. ``` -------------------------------- ### Transient Attribute Annotation Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-JSON.package/VOTransientDescription.class/README.md This annotation indicates that an attribute will not be persisted or retrieved by the Voyage driver. It's useful for temporary or calculated fields within your objects. ```Pharo Object subclass: #MyObject instanceVariableNames: 'persistentAttribute transientAttribute' classVariableNames: '' package: 'MyPackage'. MyObject >> transientAttribute: "This attribute is marked as transient and will not be persisted." ^ transientAttribute. ``` -------------------------------- ### Update Existing Object Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Model-Core.package/VOUpdateOperation.class/README.md This operation is used to modify an existing object within the database. It assumes the object already has an identifier and is present in the database. -------------------------------- ### MongoDB E11000 Duplicate Key Error Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Mongo-Core.package/VOMongoInsertError.class/README.md This entry describes the E11000 duplicate key error in MongoDB, which occurs when attempting to insert a document that violates a unique index constraint. It references the official MongoDB documentation for detailed information. ```APIDOC E11000 Duplicate Key Error: Description: Occurs when an insert operation violates a unique index constraint. Reference: https://docs.mongodb.com/v4.0/reference/command/insert/#dbcmd.insert ``` -------------------------------- ### Remove All Objects from ArangoDB Collection Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Arango-Core.package/VOArangoRemoveAllOperation.class/README.md This Pharo code snippet demonstrates how to remove all objects from a specified ArangoDB collection. It utilizes the Voyage framework's ArangoDB driver to perform the deletion operation. ```Pharo VoyageArangoDBCollection>>removeAllObjects "Remove all objects from the collection." self driver deleteCollection: self name. ``` -------------------------------- ### Remove Single Object from ArangoDB Source: https://github.com/pharo-nosql/voyage/blob/master/mc/Voyage-Arango-Core.package/VOArangoRemoveObjectOperation.class/README.md This code snippet demonstrates how to remove a single object from an ArangoDB database. It is part of the Voyage project's ArangoDB specific implementation. ```Pharo Smalltalk ArangoDBRemoveSingleObjectCommand "Example of removing a single object" | command | command := self new. command database: 'myDatabase'. command collection: 'myCollection'. command key: 'myObjectKey'. command execute. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.