@furystack/mongodb-store 10.0.27 → 10.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +12 -4
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -5,16 +5,24 @@ MongoDB physical store implementation for FuryStack.
5
5
  ## Initialization
6
6
 
7
7
  ```ts
8
- import '@furystack/mongodb-store'
8
+ import { Injector } from '@furystack/inject'
9
+ import { StoreManager } from '@furystack/core'
10
+ import { useMongoDb } from '@furystack/mongodb-store'
9
11
 
10
12
  export class TestEntry {
11
13
  declare _id: string
12
14
  declare value: string
13
15
  }
14
16
 
15
- myInjector.setupStores((sm) => {
16
- sm.useMongoDb(TestEntry, 'mongodb://localhost:27017', 'test', 'TestEntries')
17
+ const myInjector = new Injector()
18
+ useMongoDb({
19
+ injector: myInjector,
20
+ model: TestEntry,
21
+ primaryKey: '_id',
22
+ url: 'mongodb://localhost:27017',
23
+ db: 'test',
24
+ collection: 'TestEntries',
17
25
  })
18
26
 
19
- const myMongoStore = myInjector.getInstance(StoreManager).getStoreFor(TestEntry)
27
+ const myMongoStore = myInjector.getInstance(StoreManager).getStoreFor(TestEntry, '_id')
20
28
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@furystack/mongodb-store",
3
- "version": "10.0.27",
3
+ "version": "10.0.28",
4
4
  "description": "MongoDB Store implementation for FuryStack",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -37,9 +37,9 @@
37
37
  },
38
38
  "homepage": "https://github.com/furystack/furystack",
39
39
  "dependencies": {
40
- "@furystack/core": "^15.0.27",
41
- "@furystack/inject": "^12.0.21",
42
- "@furystack/utils": "^8.1.3",
40
+ "@furystack/core": "^15.0.28",
41
+ "@furystack/inject": "^12.0.22",
42
+ "@furystack/utils": "^8.1.4",
43
43
  "mongodb": "6.20.0",
44
44
  "semaphore-async-await": "^1.5.1"
45
45
  },