@atscript/db-mongo 0.1.204 → 0.1.206
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/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -1056,7 +1056,7 @@ function buildToLookup(source, target, withRel, relation, foreignKeys) {
|
|
|
1056
1056
|
}
|
|
1057
1057
|
/** $lookup for FROM relations (FK is on target → this table). */
|
|
1058
1058
|
function buildFromLookup(source, target, withRel, relation) {
|
|
1059
|
-
const remoteFK = findRemoteFK(target, source.
|
|
1059
|
+
const remoteFK = findRemoteFK(target, source.relationTableName, relation.alias);
|
|
1060
1060
|
return remoteFK ? directLookup(source, target, withRel, relation, remoteFK.targetFields, remoteFK.fields, "pk_", relation.isArray) : void 0;
|
|
1061
1061
|
}
|
|
1062
1062
|
/**
|
|
@@ -1091,7 +1091,7 @@ function directLookup(source, target, withRel, relation, sourceFields, targetFie
|
|
|
1091
1091
|
function buildViaLookup(source, target, withRel, relation, tableResolver) {
|
|
1092
1092
|
const junction = resolveReadable(tableResolver, relation.viaType?.());
|
|
1093
1093
|
if (!junction) return;
|
|
1094
|
-
const fkToThis = findRemoteFK(junction, source.
|
|
1094
|
+
const fkToThis = findRemoteFK(junction, source.relationTableName);
|
|
1095
1095
|
if (!fkToThis) return;
|
|
1096
1096
|
const fkToTarget = findRemoteFK(junction, (0, _atscript_db.tableNameOf)(relation.targetType()));
|
|
1097
1097
|
if (!fkToTarget) return;
|
package/dist/index.mjs
CHANGED
|
@@ -1055,7 +1055,7 @@ function buildToLookup(source, target, withRel, relation, foreignKeys) {
|
|
|
1055
1055
|
}
|
|
1056
1056
|
/** $lookup for FROM relations (FK is on target → this table). */
|
|
1057
1057
|
function buildFromLookup(source, target, withRel, relation) {
|
|
1058
|
-
const remoteFK = findRemoteFK(target, source.
|
|
1058
|
+
const remoteFK = findRemoteFK(target, source.relationTableName, relation.alias);
|
|
1059
1059
|
return remoteFK ? directLookup(source, target, withRel, relation, remoteFK.targetFields, remoteFK.fields, "pk_", relation.isArray) : void 0;
|
|
1060
1060
|
}
|
|
1061
1061
|
/**
|
|
@@ -1090,7 +1090,7 @@ function directLookup(source, target, withRel, relation, sourceFields, targetFie
|
|
|
1090
1090
|
function buildViaLookup(source, target, withRel, relation, tableResolver) {
|
|
1091
1091
|
const junction = resolveReadable(tableResolver, relation.viaType?.());
|
|
1092
1092
|
if (!junction) return;
|
|
1093
|
-
const fkToThis = findRemoteFK(junction, source.
|
|
1093
|
+
const fkToThis = findRemoteFK(junction, source.relationTableName);
|
|
1094
1094
|
if (!fkToThis) return;
|
|
1095
1095
|
const fkToTarget = findRemoteFK(junction, tableNameOf(relation.targetType()));
|
|
1096
1096
|
if (!fkToTarget) return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/db-mongo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.206",
|
|
4
4
|
"description": "Mongodb plugin for atscript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"atscript",
|
|
@@ -46,19 +46,19 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@atscript/core": "^0.2.
|
|
50
|
-
"@atscript/typescript": "^0.2.
|
|
49
|
+
"@atscript/core": "^0.2.29",
|
|
50
|
+
"@atscript/typescript": "^0.2.29",
|
|
51
51
|
"@uniqu/core": "^0.2.2",
|
|
52
52
|
"mongodb": "^6.17.0",
|
|
53
53
|
"mongodb-memory-server-core": "^10.0.0",
|
|
54
|
-
"unplugin-atscript": "^0.2.
|
|
54
|
+
"unplugin-atscript": "^0.2.29"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@atscript/core": "^0.2.
|
|
58
|
-
"@atscript/typescript": "^0.2.
|
|
57
|
+
"@atscript/core": "^0.2.29",
|
|
58
|
+
"@atscript/typescript": "^0.2.29",
|
|
59
59
|
"@uniqu/core": "^0.2.2",
|
|
60
60
|
"mongodb": "^6.17.0",
|
|
61
|
-
"@atscript/db": "^0.1.
|
|
61
|
+
"@atscript/db": "^0.1.206"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"build": "vp pack",
|