Skip to content

Commit

Permalink
Remove annoying database log
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuyk committed Jul 16, 2023
1 parent 9ee51e8 commit aae3d9b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.8

- Remove annoying database log

# 1.0.7

- Fix logger timestamps
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stuyk/cross-resource-cache",
"version": "1.0.7",
"version": "1.0.8",
"description": "add mongodb database saving to cross resource environments for altv",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
8 changes: 0 additions & 8 deletions src/cache/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ async function writeToDatabase(entity: alt.Entity, data: { [key: string]: any })
const collection = <string>entity.getMeta('collection');

const db = await Database.getMongoClient();
const existingCollections = await db.listCollections().toArray();
if (!existingCollections.findIndex((x) => x.name === collection)) {
try {
await db.createCollection(collection);
} catch (err) {
console.error(`Could not create collection: ${collection}`);
}
}

try {
const filter = { _id: new ObjectId(_id) };
Expand Down

0 comments on commit aae3d9b

Please sign in to comment.