@mastra/convex 1.9.1-alpha.0 → 1.9.1-alpha.1
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/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +2 -2
- package/dist/index.cjs +17 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -26
- package/dist/index.js.map +1 -1
- package/dist/vector/index.d.ts +1 -0
- package/dist/vector/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2789,38 +2789,29 @@ var ConvexVector = class extends MastraVector {
|
|
|
2789
2789
|
if (!value.some((cond) => this.matchesFilterConditions(recordMetadata, cond))) return false;
|
|
2790
2790
|
continue;
|
|
2791
2791
|
}
|
|
2792
|
-
if (typeof value === "object" && value !== null &&
|
|
2793
|
-
if (!
|
|
2794
|
-
continue;
|
|
2795
|
-
}
|
|
2796
|
-
if (typeof value === "object" && value !== null && "$nin" in value) {
|
|
2797
|
-
if (Array.isArray(value.$nin) && value.$nin.includes(recordMetadata[key])) return false;
|
|
2798
|
-
continue;
|
|
2799
|
-
}
|
|
2800
|
-
if (typeof value === "object" && value !== null && "$gt" in value) {
|
|
2801
|
-
if (!(recordMetadata[key] > value.$gt)) return false;
|
|
2802
|
-
continue;
|
|
2803
|
-
}
|
|
2804
|
-
if (typeof value === "object" && value !== null && "$gte" in value) {
|
|
2805
|
-
if (!(recordMetadata[key] >= value.$gte)) return false;
|
|
2806
|
-
continue;
|
|
2807
|
-
}
|
|
2808
|
-
if (typeof value === "object" && value !== null && "$lt" in value) {
|
|
2809
|
-
if (!(recordMetadata[key] < value.$lt)) return false;
|
|
2810
|
-
continue;
|
|
2811
|
-
}
|
|
2812
|
-
if (typeof value === "object" && value !== null && "$lte" in value) {
|
|
2813
|
-
if (!(recordMetadata[key] <= value.$lte)) return false;
|
|
2814
|
-
continue;
|
|
2815
|
-
}
|
|
2816
|
-
if (typeof value === "object" && value !== null && "$ne" in value) {
|
|
2817
|
-
if (recordMetadata[key] === value.$ne) return false;
|
|
2792
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value) && Object.keys(value).some((k) => k.startsWith("$"))) {
|
|
2793
|
+
if (!this.matchesFieldOperators(recordMetadata[key], value)) return false;
|
|
2818
2794
|
continue;
|
|
2819
2795
|
}
|
|
2820
2796
|
if (recordMetadata[key] !== value) return false;
|
|
2821
2797
|
}
|
|
2822
2798
|
return true;
|
|
2823
2799
|
}
|
|
2800
|
+
matchesFieldOperators(fieldValue, operators) {
|
|
2801
|
+
return Object.entries(operators).every(([operator, operand]) => {
|
|
2802
|
+
switch (operator) {
|
|
2803
|
+
case "$eq": return fieldValue === operand;
|
|
2804
|
+
case "$ne": return fieldValue !== operand;
|
|
2805
|
+
case "$in": return Array.isArray(operand) && operand.includes(fieldValue);
|
|
2806
|
+
case "$nin": return !(Array.isArray(operand) && operand.includes(fieldValue));
|
|
2807
|
+
case "$gt": return fieldValue > operand;
|
|
2808
|
+
case "$gte": return fieldValue >= operand;
|
|
2809
|
+
case "$lt": return fieldValue < operand;
|
|
2810
|
+
case "$lte": return fieldValue <= operand;
|
|
2811
|
+
default: return false;
|
|
2812
|
+
}
|
|
2813
|
+
});
|
|
2814
|
+
}
|
|
2824
2815
|
async callStorage(request) {
|
|
2825
2816
|
return this.client.callStorage(request);
|
|
2826
2817
|
}
|