The key of the array to filter
The callback filter function to use
Optionaloptions: methodOptionsThe options to use
A promise if the driver is async, otherwise an array of filtered values
const db = new GoodDB(new JSONDriver({
path: './database.json'
}));
db.filter('users', (user) => user.age > 18);
const db = new GoodDB(new MongoDBDriver({
uri: "..."
}));
await db.connect();
await db.filter('users', (user) => user.age > 18);
Filter values in an array stored in a key