Skip to content

Commit

Permalink
Fix collection meta bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuyk committed Jul 14, 2023
1 parent 4a11053 commit 92cce9f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.6

- Fix small bug where `sync` did not set `collection` for proper updating.

# 1.0.5

- Fix small bug with `_id` in update function
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.5",
"version": "1.0.6",
"description": "add mongodb database saving to cross resource environments for altv",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/cache/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ export async function sync(entity: alt.Entity, _id: string, collection: string)

try {
dataSet = await db.collection(collection).findOne({ _id: new ObjectId(_id) });
entity.setMeta('collection', collection);
} catch (err) {
console.error(`Could not find document for ${_id} in collection ${collection}`);
return false;
Expand Down

0 comments on commit 92cce9f

Please sign in to comment.