In the example shown in the Quick Start, the db doesn't have the method search on the defaultTable. Only when you create a new table instance that you can perform searches.
`Future main() async {
// Create the database
final db = TinyDb(MemoryStorage());
try {
// Use the database
await db.insert({'name': 'John', 'age': 30});
final results = await db.search(where('name').equals('John')); // The method 'search' isn't defined for the type 'TinyDb'.
print(results);
} finally {
// Always close the database when done
await db.close();
}
}`
In the example shown in the Quick Start, the db doesn't have the method
searchon the defaultTable. Only when you create a new table instance that you can perform searches.`Future main() async {
// Create the database
final db = TinyDb(MemoryStorage());
try {
// Use the database
await db.insert({'name': 'John', 'age': 30});
final results = await db.search(where('name').equals('John')); // The method 'search' isn't defined for the type 'TinyDb'.
print(results);
} finally {
// Always close the database when done
await db.close();
}
}`