🎪Databases¶
Databases¶
- class GoldyBot.goldy.database.databases.GoldyDB(core_database: Database, db_code_name: str)[source]¶
Bases:
object
A class representing a singular goldy bot database in mongoDB.
- async edit(collection: str, query, data: dict, overwrite: bool = False) dict [source]¶
Finds and edits a document in this database and collection with the data provided.
- async find(collection: str, query, key: str, max_to_find=50) List[dict] [source]¶
Searches for and returns documents with that query in a collection in this database.
- async find_all(collection: str, max_to_find=100) List[dict] | None [source]¶
Finds and returns all documents in a collection from this database. This took me a day to make! 😞
- async find_one(collection: str, query: dict) dict | None [source]¶
Searches for and returns specific data (document) from a collection in this database.
- async insert(collection: str, data) None [source]¶
Inserts the data provided into a collection in this database. Creates a whole new document. If you want to edit an existing document use .edit()