@absolutejs/absolute 0.19.0-beta.627 → 0.19.0-beta.628

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/ai/index.js CHANGED
@@ -28832,11 +28832,13 @@ var buildPostgresFilterPlan = (filter, startIndex = 0) => {
28832
28832
  }
28833
28833
  let actualSql;
28834
28834
  let metadataPathSegments = [];
28835
+ let metadataValueSql;
28835
28836
  if (isScalarField) {
28836
28837
  actualSql = key === "chunkId" ? "chunk_id" : key;
28837
28838
  } else {
28838
28839
  metadataPathSegments = jsonPath ?? [];
28839
28840
  actualSql = `jsonb_extract_path_text(metadata, ${metadataPathSegments.map((segment) => `'${segment}'`).join(", ")})`;
28841
+ metadataValueSql = `metadata #> '{${metadataPathSegments.join(",")}}'`;
28840
28842
  }
28841
28843
  if (!isOperatorFilterRecord(value)) {
28842
28844
  const binding = toPostgresFilterBinding(value);
@@ -28846,18 +28848,10 @@ var buildPostgresFilterPlan = (filter, startIndex = 0) => {
28846
28848
  clauses.push(`${actualSql} = ${bind(String(binding))}`);
28847
28849
  continue;
28848
28850
  }
28849
- if (!isScalarField) {
28850
- if (metadataPathSegments.length === 1 && Object.keys(value).length === 1 && Object.prototype.hasOwnProperty.call(value, "$exists")) {
28851
- const metadataKey = metadataPathSegments[0] ?? "";
28852
- clauses.push(Boolean(value.$exists) ? `metadata ? '${metadataKey}'` : `NOT (metadata ? '${metadataKey}')`);
28853
- continue;
28854
- }
28855
- return null;
28856
- }
28857
28851
  const operatorClauses = Object.entries(value).map(([operator, expected]) => {
28858
28852
  switch (operator) {
28859
28853
  case "$exists":
28860
- return expected ? `${actualSql} IS NOT NULL` : `${actualSql} IS NULL`;
28854
+ return isScalarField ? expected ? `${actualSql} IS NOT NULL` : `${actualSql} IS NULL` : expected ? `${metadataValueSql} IS NOT NULL` : `${metadataValueSql} IS NULL`;
28861
28855
  case "$in": {
28862
28856
  if (!Array.isArray(expected) || expected.length === 0) {
28863
28857
  return null;
@@ -32407,5 +32401,5 @@ export {
32407
32401
  addRAGEvaluationSuiteCase
32408
32402
  };
32409
32403
 
32410
- //# debugId=694D0C1FCC15528664756E2164756E21
32404
+ //# debugId=4E21C380231F993464756E2164756E21
32411
32405
  //# sourceMappingURL=index.js.map