@x12i/memorix-retrieval 1.16.0 → 1.17.0
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.
- package/README.md +37 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -177,6 +177,43 @@ db.<canonicalCollection>.createIndex({ _graphRuns: 1 }, { sparse: true, name: "i
|
|
|
177
177
|
|
|
178
178
|
Nested path filters (`_graphRuns.<graphId>.status`) use the sparse top-level index as baseline; per-graph compound indexes remain opt-in via `@x12i/memorix-writer` `ensureGraphRunIndexes`.
|
|
179
179
|
|
|
180
|
+
## Job-type run stamps (`_jobTypeRuns`) — MRX-CR-003
|
|
181
|
+
|
|
182
|
+
Parallel to `_graphRuns`, eligibility and reprocessing can use `_jobTypeRuns.<jobTypeId>` (sanitized map keys). Read helper:
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
import { getJobTypeRun } from "@x12i/memorix-mongo";
|
|
186
|
+
|
|
187
|
+
await getJobTypeRun(retrieval, "assets", recordId, jobTypeId, "core");
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Writer stamp APIs: `@x12i/memorix-writer` — see [memorix-writer/docs/JOB-TYPE-RUNS.md](../memorix-writer/docs/JOB-TYPE-RUNS.md).
|
|
191
|
+
|
|
192
|
+
Baseline sparse index:
|
|
193
|
+
|
|
194
|
+
```javascript
|
|
195
|
+
db.<canonicalCollection>.createIndex({ _jobTypeRuns: 1 }, { sparse: true, name: "idx_jobTypeRuns" });
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Per-jobType compound indexes: `@x12i/memorix-writer` `ensureJobTypeRunIndexes` creates:
|
|
199
|
+
|
|
200
|
+
- `{ "_jobTypeRuns.<key>.status": 1, <idField>: 1 }`
|
|
201
|
+
- `{ "_jobTypeRuns.<key>.completedAt": -1 }`
|
|
202
|
+
- `{ "_jobTypeRuns.<key>.status": 1, "_jobTypeRuns.<key>.completedAt": -1 }` (reprocessing filters)
|
|
203
|
+
|
|
204
|
+
## Linked record resolution — MRX-CR-004
|
|
205
|
+
|
|
206
|
+
```typescript
|
|
207
|
+
import { resolveLinkedRecordIds } from "@x12i/memorix-mongo";
|
|
208
|
+
|
|
209
|
+
const { entity, recordIds } = await resolveLinkedRecordIds(
|
|
210
|
+
retrieval,
|
|
211
|
+
sourceEntity,
|
|
212
|
+
sourceDoc,
|
|
213
|
+
relationshipKey,
|
|
214
|
+
);
|
|
215
|
+
```
|
|
216
|
+
|
|
180
217
|
**Estimated counts:** Pass `estimated: true` for large unfiltered totals (`estimatedDocumentCount` / `$collStats`). Graph-run bucket counts always use exact `countDocuments` even when `estimated: true`.
|
|
181
218
|
|
|
182
219
|
### Entity identity field
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x12i/memorix-retrieval",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"description": "Read-side runtime data tier for Memorix: inventory, lists, items, slices, graph, and health",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@x12i/helpers": "^1.7.0",
|
|
39
39
|
"@x12i/logxer": "^4.6.0",
|
|
40
40
|
"@x12i/memorix-agents": "^1.2.1",
|
|
41
|
-
"@x12i/memorix-descriptors": "
|
|
41
|
+
"@x12i/memorix-descriptors": "file:../memorix-descriptors",
|
|
42
42
|
"@x12i/xronox": "^3.9.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|