@frogfish/k2db 3.0.4 → 3.0.6

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/db.js +7 -3
  2. package/package.json +1 -1
package/db.js CHANGED
@@ -1182,8 +1182,10 @@ export class K2DB {
1182
1182
  }
1183
1183
  else if (lu.localField && lu.foreignField) {
1184
1184
  // Convert simple lookup to pipeline lookup so we can enforce owner scope (and deleted) in foreign coll.
1185
- const localVar = "__lk";
1186
- const ownerVar = "__own";
1185
+ // NOTE: MongoDB aggregation user variables must start with a letter.
1186
+ // Avoid leading underscores (e.g. "__lk") which fail to parse on MongoDB.
1187
+ const localVar = "k2lk";
1188
+ const ownerVar = "k2own";
1187
1189
  lu.let = { [localVar]: `$${lu.localField}`, [ownerVar]: normalizedScope };
1188
1190
  lu.pipeline = [
1189
1191
  {
@@ -1276,7 +1278,9 @@ export class K2DB {
1276
1278
  }
1277
1279
  else if (lu.localField && lu.foreignField) {
1278
1280
  // Convert simple lookup to pipeline lookup to filter _deleted
1279
- const localVar = "__lk";
1281
+ // NOTE: MongoDB aggregation user variables must start with a letter.
1282
+ // Avoid leading underscores (e.g. "__lk") which fail to parse on MongoDB.
1283
+ const localVar = "k2lk";
1280
1284
  lu.let = { [localVar]: `$${lu.localField}` };
1281
1285
  lu.pipeline = [
1282
1286
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frogfish/k2db",
3
- "version": "3.0.4",
3
+ "version": "3.0.6",
4
4
  "description": "A data handling library for K2 applications.",
5
5
  "type": "module",
6
6
  "main": "data.js",