Basic Usage

Here's how to use Effortless with a bit more control over your database:

Importing Effortless

Start by importing the necessary components from Effortless:

from effortless import EffortlessDB, Field

Creating a Database Instance

Create a new Effortless instance:

db = EffortlessDB()

Adding Entries to the Database

Use db.add() to insert new entries into the database:

db.add({"name": "Charlie", "age": 35}) db.add({"name": "David", "age": 28})

Filtering Entries

Use db.filter() with a Field condition to find specific entries:

result = db.filter(Field("age").greater_than(30)) print(result) # Output: [{'name': 'Charlie', 'age': 35}]

Updating Entries

Use db.update() to modify a single entry that matches a condition:

db.update({"age": 36}, Field("name").equals("Charlie"))

Removing Entries

Use db.remove() to delete a single entry that matches a condition:

db.remove(Field("name").equals("David"))

This basic usage allows you to create a specific database instance, add entries, perform filtering operations, and update or remove individual entries.

Effortless Usage Advanced Usage