MongoDBMemory
NoSQL document storage with flexible schema design and MongoDB-specific features.Import
Constructor
Configuration
Configuration for MongoDB memory storage extending BaseMemory options
Basic Usage
Core Interface Methods
MongoDBMemory inherits from BaseMemory and implements all standard memory interface methods. For complete API documentation includinglist(), add(), addList(), delete(), retrieve(), clear(), getCount(), isEmpty(), and branching methods, see the BaseMemory API Reference.
Auto-Connection Setup
Unique Features
- Auto-Connection Setup: No manual client creation required
- Flexible Schema: Document-based storage with dynamic schema
- No Predefined Structure: Adapt to changing requirements without migrations
- JSON-Native: Natural handling of complex nested data structures
- Horizontal Scaling: Built-in support for MongoDB sharding and replication
Limitations
- Eventual Consistency: In distributed setups, reads may not immediately reflect writes
- Memory Usage: Large documents can consume significant memory
- Complex Joins: Limited support for complex relational operations
- Learning Curve: Requires understanding of MongoDB concepts and query language